PCAP_SET_PROMISC(3)

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

πŸ’… PCAP_SET_PROMISC πŸ’…

okay so bestie, welcome to pcap_set_promisc(3) β€” a whole little library-function moment, section 3 of the manual, living in the pcap family. she's small, she's specific, and she does exactly one thing. no cap. πŸŽ€


✨ NAME ✨

pcap_set_promisc β€” set promiscuous mode for a not-yet-activated capture handle πŸ¦‹

like, the not-yet-activated part is the whole vibe check here, bestie. remember it. it's giving "read the room before you walk in." πŸ’€


🌸 SYNOPSIS 🌸

#include <pcap/pcap.h>

int pcap_set_promisc(pcap_t *p, int promisc);

so you pull in the header, and you call her with a handle and a number. that's it. iconic. ✨


πŸ’– DESCRIPTION πŸ’–

pcap_set_promisc() sets whether promiscuous mode should be set on a capture handle when the handle is activated. highkey the key phrase there β€” she doesn't flip the switch right this second, she just leaves a little sticky note for activation time. 🫢

  • if promisc is non-zero β†’ promiscuous mode will be set (yas πŸ”₯)
  • otherwise β†’ it will not be set (not today πŸ’…)

that's the entire function. she's lowkey minimal and we respect her for it. πŸ‘‘


⭐ RETURN VALUE ⭐

  • 0 β€” slay, success, we did it πŸŽ‰
  • PCAP_ERROR_ACTIVATED β€” returned if you call her on a capture handle that has already been activated 😭
fr fr, do not call this on an already-activated handle. she will hand you PCAP_ERROR_ACTIVATED and you will have to sit with that. πŸ™ˆ

πŸ¦‹ SEE ALSO πŸ¦‹

(go read pcap_create(3) and pcap_activate(3) next, bestie β€” that's the whole lifecycle she lives inside. iykyk 🧚)


that's the page!! 3 January 2014 is when this beauty was dated, and the source/version stitched across the top and bottom is PCAP_SET_PROMISC(3) from the Library Functions Manual. mwah. go set some promiscuous mode (on a handle that is not yet activated, obviously). πŸ’œπŸŽ€βœ¨

πŸ“¦ where this page comes from