radcli_avp...efix_by_num(3)

πŸ“¦ version 2.0.1, in arch rolling

🌸 radcli_avp_add_ip4prefix_by_num(3) 🌸

okay so bestie, welcome to the Radius client library docs β€” yes, that's the manual name, and yes, this page is about exactly one iconic little function. buckle up πŸŽ€


πŸ’… NAME

radcli_avp_add_ip4prefix_by_num β€” look up an IPv4-prefix-typed attribute by its legacy numeric ID and append it. that's it, that's the whole vibe. ✨

πŸ¦‹ SYNOPSIS

#include <radcli/>

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

πŸ‘‘ DESCRIPTION

it's giving "find the attribute, add the attribute." this one goes hunting through the dictionary for an IPv4-prefix-typed attribute using the old-school numeric ID, then appends it to your list. no cap, that's the whole plot. πŸ’–

πŸ“ PARAMETERS

  • list β€” the destination list, aka where the good stuff gets dropped off. 🫢
  • ctx β€” a context with a dictionary loaded. it literally cannot do the lookup without it, so don't skip this one. πŸ™ˆ
  • attrid β€” the attribute ID. this is either a PW_* constant, or a vendor type ID when vendor is non-zero. iykyk. ⭐
  • vendor β€” the vendor PEN, or 0 for a standard attribute. zero means "no vendor, we're normal about this." πŸ’€
  • value β€” the address. the actual struct in_addr. πŸ¦‹
  • prefix β€” the prefix length, and it's 0-32. that's a hard range, bestie, don't push it. πŸ”₯

🌈 RETURN VALUE

  • 0 on success β€” slay, it worked. πŸ‘‘
  • -1 on failure β€” that's either no such attribute, or it fails the same way radcli_avp_add_ip4prefix() does. 😭
ngl, a -1 can mean two different things here, so if you're debugging, keep both possibilities in mind. 🧚

✨ SEE ALSO

the whole _by_num friend group, honestly. go read them all. πŸ’œ


and that's the page, bestie β€” brought to you by radcli, dated 2026-10-10, footer energy and all. go forth and prefix responsibly πŸŒΈπŸ’…

πŸ“¦ where this page comes from