radcli_avp_..._str_by_num(3)

πŸ“¦ version 2.0.1, in arch rolling

πŸ’… 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, or NULL if you only wanna compute the needed size. (See radcli_avp_concat_str() for the deets, bestie.)
  • buflen β€” size of buf, in bytes; it may be 0.
  • list β€” the list to search. go find her πŸ”
  • ctx β€” a context with a dictionary loaded.
  • attrid β€” the attribute ID (a PW_* constant, or a vendor type ID when vendor is non-zero).
  • vendor β€” the vendor PEN, or 0 for a standard attribute.
  • sep β€” the separator inserted between occurrences; NULL or "" 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:


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