rc_avpair_log(3)

πŸ“¦
version 1.5.2 Β· 4 versions
, in alpine 3.24, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

rc_avpair_log(3) πŸ’–

okay bestie, welcome to the radcli (Radius client library) glow-up tour, page rc_avpair_log(3). buckle up, this one's short but it's mighty. πŸ¦‹


✨ NAME ✨

rc_avpair_log -

(and yes, the description slot is literally empty in the original. iconic. leaving it blank, we respect the source material πŸ’…)


✨ SYNOPSIS ✨

#include <radcli/radcli.h>

char * rc_avpair_log(
    rc_handle const  *rh,
    VALUE_PAIR       *pair,
    char             *buf,
    size_t            buf_len
);

✨ DESCRIPTION ✨

so what does it DO. it takes a whole sequence of attribute value pairs and formats them into a printable string. that's the whole vibe. πŸ’–

and heads up β€” you have to bring the storage. the caller should provide a storage buffer and the buffer length. no buffer, no glory. πŸŽ€


✨ PARAMETERS ✨

  • rh β€” a handle to parsed configuration. the little config brain. 🧠
  • pair β€” a pointer to a VALUE_PAIR structure. the thing we're stringifying. ✨
  • buf β€” this is the one that will hold the string output of the pair. your lil container bestie. 🫢
  • buf_len β€” the size of buf. pls get this right, no cap. πŸ“

✨ STRUCTURES ✨

⚠️ Avoid using this structure directly. Use the rc_avpair_get_ functions. like, seriously, don't touch it with your bare hands. use the getters. πŸ™ˆ
struct rc_value_pair {
  char                   name[RC_NAME_LENGTH+1];      // attribute name if known.
  uint64_t               attribute; // attribute numeric value of type rc_attr_id including vendor; use VENDOR() and ATTRID() to separate.
  rc_attr_type           type;      // attribute type.
  uint32_t               lvalue;    // attribute value if type is PW_TYPE_INTEGER, PW_TYPE_DATE or PW_TYPE_IPADDR.
  char                   strvalue[AUTH_STRING_LEN+1];  // contains attribute value in other cases.
  struct rc_value_pair  *next;
  char                   pad[32];       // unused pad
};

okay the way that pad[32] is just sitting there, unused, doing nothing, living its best life 😭 we love a filler era. and peep attribute β€” it's the numeric value of type rc_attr_id including vendor, so use VENDOR() and ATTRID() to separate. iykyk. πŸ’…


✨ RETURN VALUE ✨

a pointer to the provided storage buffer. that's it. that's the return. πŸ”₯


✨ SEE ALSO ✨

the whole friend group, fr fr. go say hi to all of them:


and that's the whole page bestie, you ate it up. πŸ’…βœ¨ this one's from radcli, dated 2023-01-29 β€” so when you cite it, you know who to thank. mwah, go format some attribute value pairs. πŸŽ€πŸ’–

πŸ“¦ where this page comes from