BSDE_GET_RULE_COUNT(3)

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

πŸ’… BSDE_GET_RULE_COUNT(3) πŸ’…

okay bestie, so this is a Library Functions Manual page (that's the manual name btw, in case you were wondering) and honestly? it's giving "tiny but mighty". let's get into it 🫢


✨ NAME ✨

bsde_get_rule_count, bsde_get_rule_slots β€” file system firewall statistics πŸŽ€

like… it's literally the stats girlies of the file system firewall world. no cap.


πŸ“š LIBRARY πŸ“š

File System Firewall Interface Library (libugidfw, -lugidfw) β€” yes you gotta link it, that's the vibe πŸ’œ


🌸 SYNOPSIS 🌸

#include <ugidfw.h>

int
bsde_get_rule_count(size_t errlen, char *errstr);

int
bsde_get_rule_slots(size_t errlen, char *errstr);

two functions, same shape, both returning int. slay ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, bestie β˜•:

  • bsde_get_rule_count() returns the total number of enforced rules. periodt.
  • bsde_get_rule_slots() returns the total number of used rule slots. also periodt.

they're two icons doing two different jobs and honestly I respect that πŸ’…

and if something goes wrong? 😭 *errstr gets filled in with the error string β€” up to errlen characters, including the terminating NUL. so like, budget your buffer accordingly, don't be doing the most with too few bytes πŸ™ˆ

ngl errlen counting the NUL is the kind of detail that'll bite you if you're not paying attention. read it twice. love u πŸ’–

πŸ”₯ RETURN VALUES πŸ”₯

  • on success: bsde_get_rule_count() hands you the number of enforced rules, and bsde_get_rule_slots() hands you the number of rule slots (respectively, obviously β€” they don't swap jobs, this isn't that kind of library) πŸ’€
  • on failure: the return value is -1 and *errstr gets filled in as documented in β€œDESCRIPTION” up above πŸ‘†

so basically: -1 = check your errstr, bestie. that's the whole signal. 🚩


🌈 SEE ALSO 🌈

the whole friend group, honestly β€” go say hi πŸ‘‘

like literally the entire squad. iykyk 🧚


πŸŽ€ AUTHORS πŸŽ€

okay so this software was contributed to the FreeBSD Project by Network Associates Labs, the Security Research Division of Network Associates Inc., under DARPA/SPAWAR contract N66001-01-C-8035 (β€œCBOSS”), as part of the DARPA CHATS research program. iconic sponsorship moment, we love to see it ⭐


and that's the whole page bestie! this one's from Debian, dated January 7, 2003 β€” vintage but still absolutely eating πŸ’–πŸ¦‹πŸŒΈ no cap, go read ugidfw(8) next 🫢

πŸ“¦ where this page comes from