radcli_avp_add_ip4prefix(3)
π radcli_avp_add_ip4prefix(3)
okay so bestie, welcome to the radcli girlies' corner of the manual pages β¨ this one's from the Radius client library, and it's genuinely a good time, i promise.
πΈ NAME
radcli_avp_add_ip4prefix β appends an attribute that's typed as an IPv4 prefix. that's it, that's the whole gig π
π SYNOPSIS
#include <radcli/>
int radcli_avp_add_ip4prefix(
radcli_avp_list *list,
const radcli_attr_def *def,
struct in_addr value,
unsigned prefix
);
like yes, four arguments, but two of them are basically free π«Ά
π¦ DESCRIPTION
so the wire format? it's the RFC 8044 Β§3.9 one, and radcli builds it for you internally, no cap: a reserved zero octet, then the prefix length, then the 4-octet address. you don't have to touch any of that, it just happens π
now the tea on why this is its own dedicated function instead of just a prefix parameter on radcli_avp_add_ip4(): it's basically a compatibility slay. see, radcli_avp_add_ip6() took a prefix parameter right from its introduction (iconic of it), but radcli_avp_add_ip4() already shipped without one β and there are real callers out there in the wild. adding a prefix param now would force every single existing caller to update for a type that most of them literally don't even use. so instead: new function, zero breakage, main character energy π
β¨ PARAMETERS
listβ the destination list πdefβ the attribute. must beRADCLI_TYPE_IPV4PREFIX, or it's not gonna work, bestie.valueβ the address.prefixβ the prefix length, and it's gotta be0-32. no sneaking outside the range π
π₯ RETURN VALUE
0 when it slays (success). -1 when it doesn't (failure) β that's a wrong type, a prefix that's out of range, or literally anything radcli_avp_add_bytes() would give you.
fr fr, -1 is your vibe check failing. check your type and your prefix range first, iykyk.
π SEE ALSO
the whole friend group, and they all ate:
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_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_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)
k that's the whole page bestie π this absolute bop is brought to you by radcli, dated 2026-10-10 πΈ go forth and append those IPv4 prefixes, you've got this π
β¨
π¦ 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