radcli_avp...efix_by_num(3)
π
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 aPW_*constant, or a vendor type ID whenvendoris non-zero. π₯vendorβ the vendor PEN, or0for 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 beNULL. iconic, honestly. πprefixβ where the prefix length gets written. this one may beNULLtoo. 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 asradcli_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:
radcli_avp_get_by_num(3)radcli_avp_get_bytes_by_num(3)radcli_avp_get_cstr_by_num(3)radcli_avp_get_ip6_by_num(3)radcli_avp_get_uint32_by_num(3)radcli_avp_get_uint64_by_num(3)
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
- 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