PCAP_CAN_SET_RFMON(3PCAP)
β¨ pcap_can_set_rfmon β bestie, can we go monitor mode or not?? π
okay so this is from the 3PCAP girlies (the libpcap manual, section 3) and it's literally just one function whose whole job is answering a yes/no question before you commit. no cap.
πΈ SYNOPSIS πΈ
#include <pcap/pcap.h>
int pcap_can_set_rfmon(pcap_t *p);
π¦ DESCRIPTION π¦
pcap_can_set_rfmon() is the vibe-check function. It checks whether monitor mode could be set on a capture handle when that handle gets activated.
key word: could. it's not doing it. it's not promising it. it's peeking. it's the "hey are we gonna be able to do this later" text, not the "we're doing this now" text. not yet activated, bestie β that's the whole point. π
π RETURN VALUE π
0β nope, monitor mode could not be set π1β yesss, monitor mode could be set β¨ slay- negative value β an error happened, and the specific negative number tells you which error condition it was. here's the roster:
π the error values π
PCAP_ERROR_NO_SUCH_DEVICEβ the capture source you specified when the handle was created straight up doesn't exist. it's giving ghosted. π»PCAP_ERROR_PERM_DENIEDβ the process doesn't have permission to even check whether monitor mode could be supported. rude, honestly. πPCAP_ERROR_ACTIVATEDβ the capture handle has already been activated. too late, girlie, that ship sailed. π’PCAP_ERRORβ some other error happened, the catch-all. you can callpcap_geterr(3PCAP)orpcap_perror(3PCAP)withpas an argument to fetch or display a message describing the error. π«Ά
β οΈ real talk: additional error codes may be added in the future. so a program should check for0,1, and negative return codes, and treat all negative return codes as errors. do not hardcode a list of specific negatives and think you're safe, because you are not. π
and if you want a human-readable message for a warning or error code, you can call pcap_statustostr(3PCAP) with a warning or error code as an argument to fetch a message describing that warning or error code. cute, right?
π SEE ALSO π
pcap(3PCAP)pcap_create(3PCAP)pcap_activate(3PCAP)pcap_set_rfmon(3PCAP)
and that's the whole page, bestie π«Ά this was PCAP_CAN_SET_RFMON(3PCAP), dated 31 July 2016, from the libpcap manual set. go forth and vibe-check your handles before you activate them. periodt. πβ¨
π¦ 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