radcli_avp_..._str_by_num(3)
π radcli_avp_concat_str_by_num β from the Radius client library, bestie π
okay so this one lives in the Radius client library (that's the manual name, hi π), and it's the _by_num() girlie of radcli_avp_concat_str(). She looks up an attribute by its legacy numeric ID and then glues every occurrence of it together into one bounded buffer. Very "collect the whole set" of her. β¨
πΈ NAME πΈ
radcli_avp_concat_str_by_num β look up an attribute by legacy numeric ID and concatenate every occurrence into a bounded buffer.
π SYNOPSIS π
#include <radcli/>
int radcli_avp_concat_str_by_num(
char *buf,
size_t buflen,
const radcli_avp_list *list,
const radcli_ctx *ctx,
uint32_t attrid,
uint32_t vendor,
const char *sep
);
π¦ DESCRIPTION π¦
So the _by_num() wrapper for radcli_avp_concat_str() is literally equivalent to this, no cap:
radcli_avp_concat_str(buf, buflen, l, radcli_dict_lookup_num(ctx, attrid, vendor), sep)
β¦with one iconic little twist: if that attribute ID can't be resolved, that's not a failure here. Nope! It gets treated exactly the same as "no occurrence present" β buf gets set to an empty string, and 0 is returned. π
And honestly that makes total sense for her whole legacy-ID convenience role: if you're a caller passing a well-known PW_* constant, you shouldn't have to separately handle "not in this dictionary" as an error case. It's giving the same energy as rc_aaa()'s msg, which never failed just because a reply had no Reply-Message. periodt. π
π§ PARAMETERS π§
bufβ the destination buffer, orNULLif you only wanna compute the needed size. (Seeradcli_avp_concat_str()for the deets, bestie.)buflenβ size ofbuf, in bytes; it may be0.listβ the list to search. go find her πctxβ a context with a dictionary loaded.attridβ the attribute ID (aPW_*constant, or a vendor type ID whenvendoris non-zero).vendorβ the vendor PEN, or0for a standard attribute.sepβ the separator inserted between occurrences;NULLor""for none.
β RETURN VALUE β
She returns the number of bytes the joined result occupies (excluding the NUL terminator) β and yes, that's whether or not it actually fit in buf, so don't be weird about it. π«Ά
Returns 0 if attrid/vendor resolves to no attribute.
π SEE ALSO π
the whole friend group, fr fr:
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(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_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 that's the whole page, mwah π this one's from radcli, dated 2026-10-10 β go read the source bestie, ily, bye π«Άβ¨
π¦ 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