radcli_ctx_set_opt_str3
Set a string-typed configuration option.
Usage
#include <radcli/>
int radcli_ctx_set_opt_str(
radcli_ctx *ctx,
radcli_opt_id opt,
const char *val
);
Overview
Stores val for opt on ctx, validating it against opt's own grammar (e.g. #RADCLI_OPT_AUTHSERVER accepts the "host[:port[:secret]]" form a config file's authserver line does). Valid for any radcli_opt_id whose RC_OPTION_TABLE type is RADCLI_OPT_TYPE_STR or RADCLI_OPT_TYPE_SRV; use radcli_ctx_set_opt_int() for an RADCLI_OPT_TYPE_INT option instead.
Parameters
ctx-
a context from radcli_ctx_new() or radcli_ctx_read_config().
opt-
the option to set.
val-
the value; for #RADCLI_OPT_AUTHSERVER/#RADCLI_OPT_ACCTSERVER, the shared secret is better set with radcli_ctx_set_secret() than embedded in this string.
Return value
0 on success, -1 on failure (NULL ctx, opt out of range, wrong type for opt, or an invalid val for opt's grammar).