radcli_avp_add_str(3)

πŸ“¦ version 2.0.1, in arch rolling

πŸ’… radcli_avp_add_str(3) β€” the "just add a string, bestie" page

okay so this is a page from the Radius client library manpage set, and honestly? it's a lil bop. one function, does exactly what it says, no cap. let's get into it πŸŽ€


✨ NAME ✨

radcli_avp_add_str β€” appends an attribute that's string-typed or text-typed. that's it. that's the whole gig πŸ’–


🌸 SYNOPSIS 🌸

#include <radcli/>

int radcli_avp_add_str(
    radcli_avp_list        *list,
    const radcli_attr_def  *def,
    const char             *value
);

three args, one int back. clean, iconic, no notes ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so this function is the chill one β€” it takes both RADCLI_TYPE_STRING and RADCLI_TYPE_TEXT attributes and it does not make a whole thing about it.

here's the tea per-type πŸ“:

  • if def is RADCLI_TYPE_STRING, then value's bytes get copied verbatim β€” like, opaque octets, zero validation, no vibes check whatsoever. this is unchanged from this function's original behavior, and that is so on purpose: a caller who's already using this function against an attribute that later got retagged from "string" to "text" (RFC 8044 SS3.1) in the dictionary keeps on working instead of suddenly falling over with the retag. backwards compatibility ate. πŸ‘‘
  • if def is RADCLI_TYPE_TEXT, then value must additionally be valid UTF-8. invalid UTF-8 gets rejected β€” not stored, not "stored but we're not proud of it", just straight up rejected πŸ™ˆ

🧚 PARAMETERS 🧚

  • list β€” the destination list. where the lil attribute goes to live πŸ’œ
  • def β€” the attribute itself. must be RADCLI_TYPE_STRING or RADCLI_TYPE_TEXT, or we're not doing this.
  • value β€” a null-terminated string. terminating null included, bestie.

πŸ”₯ RETURN VALUE πŸ”₯

  • 0 on success β€” slay, it worked πŸŽ‰
  • -1 on failure β€” and failure happens when:
    • def is neither RADCLI_TYPE_STRING nor RADCLI_TYPE_TEXT, or
    • value is invalid UTF-8 for a RADCLI_TYPE_TEXT def, or
    • literally anything else, same as radcli_avp_add_bytes()

so if it flops, those are your suspects. check the type first, ngl πŸ’€


🌈 SEE ALSO 🌈

the whole friend group, fr fr β€” go read these next πŸ‘‘:


anyway bestie, that's the page πŸ’… this came out of radcli, dated 2026-10-10, and it's the radcli_avp_add_str(3) page specifically β€” go add some strings, you're gonna do amazing 🫢✨

πŸ“¦ where this page comes from