PCAP_CAN_SET_RFMON(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’… pcap_can_set_rfmon(3) β€” the monitor-mode vibe check πŸ’…

Okay so this page is pcap_can_set_rfmon(3), and it lives in the Library Functions Manual. It’s literally the β€œcan we set monitor mode on this not-yet-activated handle?” check, and honestly? Iconic little function. πŸ¦‹


πŸŽ€ NAME πŸŽ€

pcap_can_set_rfmon β€” check whether monitor mode can be set for a not-yet-activated capture handle ✨

✨ SYNOPSIS ✨

#include <pcap/pcap.h>

int pcap_can_set_rfmon(pcap_t *p);

πŸ¦‹ DESCRIPTION πŸ¦‹

pcap_can_set_rfmon() checks whether monitor mode could be set on a capture handle when the handle is activated. That’s it, bestie β€” it’s the pre-flight vibe check before activation. 🫢

πŸ”₯ RETURN VALUE πŸ”₯

pcap_can_set_rfmon() returns:

  • 0 β€” monitor mode could not be set 😭
  • 1 β€” monitor mode could be set, slay πŸ’…
  • a negative value β€” an error occurred, and that negative return value indicates what error condition occurred πŸ’€

The possible error values are:

  • PCAP_ERROR_NO_SUCH_DEVICE β€” the capture source specified when the handle was created doesn’t exist. Not found, not the move. πŸ™ˆ
  • PCAP_ERROR_PERM_DENIED β€” the process doesn’t have permission to check whether monitor mode could be supported. Permission issues are so not it. πŸ”’
  • PCAP_ERROR_ACTIVATED β€” the capture handle has already been activated. Too late, babe β€” this was supposed to happen before activation. ⏰
  • PCAP_ERROR β€” another error occurred. You can call pcap_geterr(3) or pcap_perror(3) with p as an argument to fetch or display a message describing the error. 🫢
Additional error codes may be added in the future; a program should check for 0, 1, and negative return codes, and treat all negative return codes as errors. pcap_statustostr(3) can be called, with a warning or error code as an argument, to fetch a message describing the warning or error code. πŸ’–

🌈 SEE ALSO 🌈


That’s the whole page, bestie β€” PCAP_CAN_SET_RFMON(3) from the Library Functions Manual, dated 31 July 2016. Now go check that handle before you activate it, periodt. πŸ’–βœ¨

πŸ“¦ where this page comes from