AU_BSM_TO_SOCKET_TYPE(3)
π au_bsm_to_socket_type, au_socket_type_to_bsm π
okay bestie, so this is a page from libbsm β that's the Basic Security Module Library β and it lives in section 3 of the manual, the whole "library functions" girlie section. buckle up, we're talking socket types today π§¦
πΈ NAME πΈ
au_bsm_to_socket_type, au_socket_type_to_bsm β the glow-up translators that convert between BSM and local socket types β¨
π¦ LIBRARY π¦
Basic Security Module Library (libbsm, -lbsm) β she's giving main character energy, link her with -lbsm π
π SYNOPSIS π
#include <bsm/libbsm.h>
int
au_bsm_to_socket_type(u_short bsm_socket_type, int *local_socket_typep);
u_short
au_socket_type_to_bsm(int local_socket_type);
β¨ DESCRIPTION β¨
so these two interfaces are literally your little conversion duo π«Ά they take you back and forth between local socket types and BSM socket types, no cap.
au_bsm_to_socket_type() takes a BSM socket type, bsm_socket_type, and converts it into a local socket type β like the ones you'd pass to socket(2) β and if it works, that converted value gets stored in the integer that local_socket_typep points at πΎ. but listen: this call will fail if the BSM socket type can't be mapped into a local socket type π and that can happen when the socket token was generated on a different operating system. so like, cross-OS drama, not her fault.
au_socket_type_to_bsm() is the chill one π
she takes a local socket type and returns the BSM socket type for it. this call cannot fail β instead it returns a BSM socket type that tells a later decoder "yeah bestie, the socket type could not be encoded" π iconic behavior honestly.
β RETURN VALUES β
on success, au_bsm_to_socket_type() returns 0 plus a converted socket type π on failure, it returns -1 β but it does not set errno(2). yes, you read that right, no errno for you π«
on success, au_strerror() returns a pointer to an error string; on failure it will return NULL π³οΈ
ngl that second paragraph is straight from the page and it does talk about au_strerror(), not the socket functions. keep that in your notes, don't @ me π
π₯ SEE ALSO π₯
π HISTORY π
au_bsm_to_socket_type() and au_socket_type_to_bsm() were introduced in OpenBSM 1.1 β vintage, but make it cute π
π AUTHORS π
these functions were implemented by Robert Watson under contract to Apple Inc. π
and the Basic Security Module (BSM) interface to audit records and audit event stream format were defined by Sun Microsystems βοΈ
mwah π this page came from the Debian crew, dated December 28, 2008 β yeah she's an elder but she still slays, and that's the whole manual page, periodt. πΈπ¦π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2008 Apple Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms