---
name: "pcap_is_swapped"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/pcap_is_swapped"
---

# pcap\_is\_swapped(3)

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**(3)](/pcap_create/3.md) that has not yet been activated by [**pcap\_activate**(3)](/pcap_activate/3.md).

## 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**(3)](/pcap/3.md)
