radcli_avp...efix_by_num(3)

πŸ“¦ version 2.0.1, in arch rolling

πŸ’… radcli_avp_get_ip4prefix_by_num β€” from the radcli Radius client library πŸ’…

okay so bestie, we're in section 3 of the radcli manual, and today's main character is radcli_avp_get_ip4prefix_by_num. what does it do? it looks up an attribute that's typed as an IPv4 prefix, finds it by its legacy numeric ID, and then reads its first occurrence. that's it, that's the whole vibe. πŸ¦‹


✨ NAME ✨

radcli_avp_get_ip4prefix_by_num β€” look up an IPv4-prefix-typed attribute by legacy numeric ID and read its first occurrence. πŸŽ€


🌸 SYNOPSIS 🌸

#include <radcli/>

int radcli_avp_get_ip4prefix_by_num(
    const radcli_avp_list  *list,
    const radcli_ctx       *ctx,
    uint32_t                attrid,
    uint32_t                vendor,
    struct in_addr         *out,
    unsigned               *prefix
);

copy it, paste it, don't retype it by hand, i'm begging πŸ™ˆ


🧚 DESCRIPTION 🧚

so here's the thing. the original page has this whole DESCRIPTION heading and then... nothing. a void. silence. a little mystery ✨ β€” the actual deets are chilling down in PARAMETERS and RETURN VALUE, so go read those, that's where the plot is. iykyk πŸ’œ


πŸ‘‘ PARAMETERS πŸ‘‘

like, literally every single one, in order, no skips:

  • list β€” the list you're searching through. your haystack, basically. πŸ“
  • ctx β€” a context that has a dictionary loaded. yes, it needs the dictionary. no, you can't skip it. 🫢
  • attrid β€” the attribute ID. this is either a PW_* constant, or a vendor type ID when vendor is non-zero. πŸ”₯
  • vendor β€” the vendor PEN, or 0 for a standard attribute. zeros are allowed here bestie, it's not a red flag. ⭐
  • out β€” where the address gets written. and get this: it may be NULL. iconic, honestly. πŸ’…
  • prefix β€” where the prefix length gets written. this one may be NULL too. flexible queen energy. 🌈

πŸ’€ RETURN VALUE πŸ’€

  • 0 β€” success. slay. we ate. πŸ‘‘
  • -1 β€” failure. and the failure cases are: no such attribute, no occurrence, or the same thing as radcli_avp_get_ip4prefix() does. 😭
ngl, when you see that -1, check which of those three it was before you start spiralling. it's giving "three different problems, one exit code." πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

the whole friend group, fr fr:


and that's the page!! πŸŽ€βœ¨ it's from radcli (that's the source, keep it in your notes bestie), dated 2026-10-10 β€” the page itself is literally titled radcli_avp...efix_by_num(3) and lives in the radcli manual. drink some water, close your NULL pointers, and go read the rest of section 3. mwah. πŸ’–πŸ«ΆπŸŒΈ

πŸ“¦ where this page comes from