PCAP_IS_SWAPPED(3PCAP)
π PCAP_IS_SWAPPED π
okay bestie, welcome to the 3PCAP section of the manual, and lemme tell you about pcap_is_swapped β she's a lil function with one job and she does it flawlessly, no notes. π
β¨ 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);
like yes, that's it, that's the whole vibe check. one include, one function, go off. π
π DESCRIPTION π
so here's the tea, bestie. pcap_is_swapped() returns true (1) if p refers to a savefile that uses a different byte order than the current system. big endian vs little endian drama, we love a cross-platform moment. π
and for a live capture? it always returns false (0). every single time. no surprises, no plot twists, just 0. periodt. β¨
π OKAY BUT REAL TALK: it must not be called on apcapdescriptor created bypcap_create(3PCAP)that has not yet been activated bypcap_activate(3PCAP). like, do not do that. it's giving unactivated handle, and the function is not gonna play nice. π
β RETURN VALUE β
pcap_is_swapped()returns true (1) or false (0) on success π- and it returns
PCAP_ERROR_NOT_ACTIVATEDif you call it on a capture handle that's been created but not activated π
so like, either a cute lil boolean or a whole error code. choose your adventure, but activate your handle first, i'm begging. π«Ά
π SEE ALSO π
pcap(3PCAP)
and that's the whole page, bestie!! sourced from the PCAP_IS_SWAPPED(3PCAP) manual, dated 7 April 2014, and honestly? iconic. timeless. no cap. π§π mwah, go activate your handles and stay byte-order aware β¨πΈ
π¦ where this page comes from
- alpine 3.22: libpcap-doc 1.10.7-r0 Β· BSD-3-Clause
- alpine 3.23: libpcap-doc 1.10.7-r0 Β· BSD-3-Clause
- alpine 3.24: libpcap-doc 1.10.7-r0 Β· BSD-3-Clause
- arch rolling: libpcap 1.11.0-1 Β· BSD-3-Clause
- centos-stream 10: libpcap-devel 14:1.10.4-8.el10 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- centos-stream 9: libpcap-devel 14:1.10.0-5.el9 Β· BSD with advertising
- centos-stream 9: libpcap-devel 14:1.10.0-5.el9 Β· BSD with advertising
- debian bookworm: libpcap0.8-dev 1.10.3-1
- debian trixie: libpcap0.8-dev 1.10.5-2
- fedora 43: libpcap-devel 14:1.10.5-3.fc43 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 43: libpcap-devel 14:1.10.5-3.fc43 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 43: libpcap-devel 14:1.10.7-1.fc43 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 43: libpcap-devel 14:1.10.7-1.fc43 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 44: libpcap-devel 14:1.10.6-2.fc44 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 44: libpcap-devel 14:1.10.6-2.fc44 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 44: libpcap-devel 14:1.10.7-1.fc44 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 44: libpcap-devel 14:1.10.7-1.fc44 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- nixos 26.05: libpcap 1.10.7
- nixpkgs unstable: libpcap 146
- opensuse-leap 16.0: libpcap-devel 1.10.5-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libpcap-devel 1.10.5-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libpcap-devel 1.10.5-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libpcap-devel 1.10.5-160000.5.1 Β· BSD-3-Clause
- ubuntu jammy: libpcap0.8-dev 1.10.1-4build1
- ubuntu jammy: libpcap0.8-dev 1.10.1-4ubuntu1.22.04.2
- ubuntu noble: libpcap0.8-dev 1.10.4-4.1ubuntu3
- ubuntu noble: libpcap0.8-dev 1.10.4-4.1ubuntu3.1
- ubuntu questing: libpcap0.8-dev 1.10.5-2ubuntu2
- ubuntu resolute: libpcap0.8-dev 1.10.6-1ubuntu1 Β· BSD-3-clause-var3
- ubuntu resolute: libpcap0.8-dev 1.10.6-1ubuntu1.1 Β· BSD-3-clause-var3
- ubuntu stonking: libpcap0.8-dev 1.10.7-1ubuntu1 Β· BSD-3-clause-var3
- Copyright (c) 1994, 1996, 1997 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms