---
name: "radcli_request_new"
section: "3"
platform: "linux"
package: "radcli"
version: "2.0.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/radcli_request_new"
---

# radcli\_request\_new(3)

Create a request to send.

## NAME

radcli\_request\_new - Create a request to send.

## SYNOPSIS

```
#include <radcli/>

radcli_request * radcli_request_new(
    radcli_ctx             *ctx,
    radcli_code             code,
    const radcli_avp_list  *send
);
```

## DESCRIPTION

Reads the destination server, its shared secret, and the timeout/retry counts from ctx's configuration  the same "authserver"/"acctserver", "radius\_timeout", and "radius\_retries" settings rc\_auth()/rc\_acct() (radcli.h) use. Unlike rc\_auth()/rc\_acct(), which fail over across every configured entry, this uses only the first: the new API carries one server per context, with redundancy delegated to DNS (several A/AAAA records for one name, tried in order within the request's timeout by radcli\_transport\_exchange()) rather than a configured list of distinct servers. A warning is logged, not an error, if more than one entry is configured, so a caller migrating one entry point at a time from the legacy API isn't broken by the leftover entries.

## PARAMETERS

- **ctx**

  a context with configuration loaded.

- **code**

  RADCLI\_CODE\_ACCESS\_REQUEST or RADCLI\_CODE\_ACCOUNTING\_REQUEST.

- **send**

  the attributes to send; copied in  send may be freed or reused by the caller immediately after this call returns.

## RETURN VALUE

the new request, or NULL on allocation failure, an invalid code, or if ctx has no server configured for that code's type.

## SEE ALSO

[*radcli\_aaa*(3)](/radcli_aaa/3.md), [*radcli\_request\_attrs*(3)](/radcli_request_attrs/3.md), [*radcli\_request\_code*(3)](/radcli_request_code/3.md), [*radcli\_request\_done*(3)](/radcli_request_done/3.md), [*radcli\_request\_free*(3)](/radcli_request_free/3.md), [*radcli\_request\_perform*(3)](/radcli_request_perform/3.md), [*radcli\_request\_server*(3)](/radcli_request_server/3.md)
