radcli_avp_add_str(3)
π 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
defisRADCLI_TYPE_STRING, thenvalue'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
defisRADCLI_TYPE_TEXT, thenvaluemust 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 beRADCLI_TYPE_STRINGorRADCLI_TYPE_TEXT, or we're not doing this.valueβ a null-terminated string. terminating null included, bestie.
π₯ RETURN VALUE π₯
0on success β slay, it worked π-1on failure β and failure happens when:defis neitherRADCLI_TYPE_STRINGnorRADCLI_TYPE_TEXT, orvalueis invalid UTF-8 for aRADCLI_TYPE_TEXTdef, 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 π:
radcli_avp_add_bytes(3)radcli_avp_add_bytes_by_num(3)radcli_avp_add_gigawords64(3)radcli_avp_add_gigawords64_by_num(3)radcli_avp_add_ip4(3)radcli_avp_add_ip4_by_num(3)radcli_avp_add_ip4prefix(3)radcli_avp_add_ip4prefix_by_num(3)radcli_avp_add_ip6(3)radcli_avp_add_ip6_by_num(3)radcli_avp_add_str_by_num(3)radcli_avp_add_uint32(3)radcli_avp_add_uint32_by_num(3)radcli_avp_add_uint64(3)radcli_avp_add_uint64_by_num(3)radcli_avp_add_username(3)radcli_avp_concat_str(3)radcli_avp_concat_str_by_num(3)radcli_avp_def(3)radcli_avp_get(3)radcli_avp_get_by_num(3)radcli_avp_get_bytes(3)radcli_avp_get_bytes_by_num(3)radcli_avp_get_cstr(3)radcli_avp_get_cstr_by_num(3)radcli_avp_get_gigawords64(3)radcli_avp_get_gigawords64_by_num(3)radcli_avp_get_ip4prefix(3)radcli_avp_get_ip4prefix_by_num(3)radcli_avp_get_ip6(3)radcli_avp_get_ip6_by_num(3)radcli_avp_get_uint32(3)radcli_avp_get_uint32_by_num(3)radcli_avp_get_uint64(3)radcli_avp_get_uint64_by_num(3)radcli_avp_iter_next(3)radcli_avp_list_error(3)radcli_avp_list_free(3)radcli_avp_list_iter(3)radcli_avp_list_new(3)
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
- arch rolling: radcli 2.0.1-1 Β· BSD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms