PCAP_SET_RFMON(3PCAP)

πŸ’– PCAP_SET_RFMON πŸ’–

okay so bestie, we're in section 3PCAP today and this one is short but it's important, so lock in 🫢

✨ NAME ✨

pcap_set_rfmon β€” set monitor mode for a not-yet-activated capture handle


🌸 SYNOPSIS 🌸

#include <pcap/pcap.h>

int pcap_set_rfmon(pcap_t *p, int rfmon);

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically, pcap_set_rfmon() decides whether monitor mode should get set on a capture handle when that handle is activated. not right now. later. at activation time. the way it's giving "I'll deal with it when I get there" πŸ’…

and like, how does it decide? simple:

  • if rfmon is non-zero, monitor mode will be set βœ…
  • otherwise it will not be set πŸ™ˆ

that's it. that's the whole function. iconic behavior honestly.


πŸ‘‘ RETURN VALUE πŸ‘‘

pcap_set_rfmon() returns 0 on success 🌈

or, if you call it on a capture handle that's already been activated, it returns PCAP_ERROR_ACTIVATED 😭 β€” like, bestie, you're too late, the handle already woke up.


πŸ’œ SEE ALSO πŸ’œ

  • pcap(3PCAP)
  • pcap_create(3PCAP)
  • pcap_activate(3PCAP)
  • pcap_can_set_rfmon(3PCAP)

ngl if you're messing with monitor mode you probably also want to vibe check pcap_can_set_rfmon(3PCAP) first before you commit. no cap. 🧚

mwah πŸ’‹ that's the page, hope it slayed. this one's from the 3 January 2014 era of the PCAP_SET_RFMON(3PCAP) manual, so shoutout to the vintage docs for carrying the whole libpcap lore. stay hydrated, stay activated (but not before you set your options) β­πŸ’–

πŸ“¦ where this page comes from