radcli_aaa(3)
β¨ NAME β¨
okay so bestie, this is radcli_aaa(3) from the Radius client library, and its whole thing is: perform an authentication or accounting exchange with Acct-Delay-Time autofill and fail-over across every configured server. π
β¨
πΈ SYNOPSIS πΈ
#include <radcli/>
int radcli_aaa(
radcli_ctx *ctx,
radcli_code code,
const radcli_avp_list *send,
radcli_code *out_code,
radcli_avp_list **out_attrs
);
π¦ DESCRIPTION π¦
So hereβs the tea: this is the new APIβs counterpart to radcli.hβs rc_aaa()/rc_auth()/rc_acct(), layered on top of the single-server radcli_request_new()/_perform() building block the same way lib/aaa_ctx.c layers over rc_auth() today. Itβs added as a separate wrapper rather than as an extension of radcli_request_perform(), so that functionβs single-server contract is untouched. Periodt. π
Unlike radcli_request_new(), which uses only the first configured "authserver"/"acctserver" entry (REQ-NET2-INIT-003), this one tries every configured entry in order and moves to the next on a timeout or unreachable-network result β exactly as rc_aaa()/rc_aaa_ctx() do. No cap, it really does go down the whole list. π₯
Unlike the legacy rc_aaa(), this has no NAS-Port autofill parameters. NAS-Port is a value the caller already knows before calling, exactly like any other attribute (NAS-IP-Address, Called-Station-Id, ...), so it belongs in send via radcli_avp_add_uint32_by_num(), not as a special-cased parameter here. Lowkey cleaner that way. π§
Acct-Delay-Time remains the one attribute radcli_aaa() computes itself, since only it can see the fail-over timing. If code is #RADCLI_CODE_ACCOUNTING_REQUEST, an Acct-Delay-Time attribute is always added (replacing any in send), measuring elapsed time from the first attempt, continuing to accumulate across a fail-over retry rather than resetting, and folding in any Acct-Delay-Time already in send as an initial offset β matching rc_fill_acct_pairs()βs (lib/buildreq.c) semantics. The way it keeps the clock running across retries? Obsessed. β±οΈπ«
π PARAMETERS π
ctxβ a context with configuration loaded. Gotta have it, bestie. π«ΆcodeβRADCLI_CODE_ACCESS_REQUESTorRADCLI_CODE_ACCOUNTING_REQUEST. Pick your main-character request type. β¨sendβ the attributes to send; copied in per attempt, sosendmay be freed or reused by the caller immediately after this call returns. No lingering attachment, fr fr. πout_codeβ if non-NULL, receives the final replyβs RADIUS code onRADCLI_OK. Itβs giving βhereβs the verdict.β πout_attrsβ if non-NULL, receives the final replyβs decoded attributes onRADCLI_OK(owned by the caller, free withradcli_avp_list_free()); left unset otherwise. PassNULLfor an Accounting-Request caller uninterested in the (typically empty) reply. Youβre so independent. π
π RETURN VALUE π
RADCLI_OKif any configured server produced a validated reply (checkout_codeforAccess-Accept/Access-Reject/Access-Challenge). Slay. π₯RADCLI_TIMEOUTif no server produced one and the last server tried timed out. Sad but at least we know. πRADCLI_ERRORon failure (NULLctx/send, an invalidcode, no server configured for that codeβs type, an allocation/encoding failure, or the last server tried being on an unreachable network). Big yikes, but listed. π
π SEE ALSO π
go read these next, bestie:
radcli_request_attrs(3)radcli_request_code(3)radcli_request_done(3)radcli_request_free(3)radcli_request_new(3)radcli_request_perform(3)radcli_request_server(3)
signed, sealed, delivered with love: radcli π«Ά β 2026-10-10 π
π¦ 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