.\" File automatically generated by doxy2man0.3 .\" Generation date: Wed Aug 19 2026 .TH rc_aaa_ctx_server 3 2026-08-19 "radcli" "Radius client library" .SH "NAME" rc_aaa_ctx_server \- Builds an authentication/accounting request and submits it to a specific server. .SH SYNOPSIS .nf .B #include .sp \fBint rc_aaa_ctx_server\fP( \fBrc_handle *\fP\fIrh\fP, \fBRC_AAA_CTX **\fP\fIctx\fP, \fBSERVER *\fP\fIaaaserver\fP, \fBrc_type \fP\fItype\fP, \fBuint32_t \fP\fInas_port\fP, \fBVALUE_PAIR *\fP\fIsend\fP, \fBVALUE_PAIR **\fP\fIreceived\fP, \fBchar *\fP\fImsg\fP, \fBint \fP\fIadd_nas_port\fP, \fBrc_standard_codes \fP\fIrequest_type\fP ); .fi .SH DESCRIPTION .PP Like rc_aaa_ctx() but sends to aaaserver instead of the server list from the configuration. Use this when the caller has already selected the server (e.g., in proxy scenarios). .SH PARAMETERS .TP .B rh a handle to parsed configuration. .TP .B ctx if non-NULL, receives an allocated RC_AAA_CTX on success; the caller must free it with rc_aaa_ctx_free(). Pass NULL if not needed. .TP .B aaaserver a non-NULL SERVER describing the target server(s). .TP .B type AUTH to use the authentication port, ACCT for the accounting port. Under TLS/DTLS only AUTH is valid (both auth and acct share the same TLS connection to the authserver). .TP .B nas_port the physical NAS port number to include (may be zero). .TP .B send VALUE_PAIR list of attributes to send (e.g., PW_USER_NAME). .TP .B received on success, receives the server's reply VALUE_PAIR list; the caller must free it with rc_avpair_free(). .TP .B msg if non-NULL, must point to a buffer of PW_MAX_MSG_SIZE bytes; will contain the concatenation of any PW_REPLY_MESSAGE attributes received. .TP .B add_nas_port if non-zero, PW_NAS_PORT is added to the sent pairs. .TP .B request_type one of the standard RADIUS codes (e.g., PW_ACCESS_REQUEST). .SH STRUCTURES .SS "" .PP .sp .PP Avoid using this structure directly, it is included for backwards compatibility only. Several of its fields have been deprecated. .sp .RS .nf \fB struct server { int \fImax\fP; char *\fIname\fP[RC_SERVER_MAX]; uint16_t \fIport\fP[RC_SERVER_MAX]; char *\fIsecret\fP[RC_SERVER_MAX]; double \fIdeadtime_ends\fP[RC_SERVER_MAX]; // unused }; \fP .fi .RE .SS "" .PP .sp .PP Avoid using this structure directly. Use rc_avpair_get_uint32() for integer/IPv4/date values, rc_avpair_get_in6() for IPv6 addresses and prefixes, rc_avpair_get_raw() for string/binary values, and rc_avpair_get_attr() to read the attribute type and ID. To iterate the list use rc_avpair_next(). Free the entire list with rc_avpair_free(). .sp .RS .nf \fB struct rc_value_pair { char \fIname\fP[RC_NAME_LENGTH+1]; // attribute name if known. uint64_t \fIattribute\fP; // attribute numeric value of type rc_attr_id including vendor; use VENDOR() and ATTRID() to separate. rc_attr_type \fItype\fP; // attribute type. uint32_t \fIlvalue\fP; // attribute value if type is PW_TYPE_INTEGER, PW_TYPE_DATE or PW_TYPE_IPADDR. char \fIstrvalue\fP[AUTH_STRING_LEN+1]; // contains attribute value in other cases. struct rc_value_pair *\fInext\fP; char \fIpad\fP[32]; // unused pad }; \fP .fi .RE .SS "" .PP .sp .PP Avoid using this structure directly. Use rc_avpair_get_uint32() for integer/IPv4/date values, rc_avpair_get_in6() for IPv6 addresses and prefixes, rc_avpair_get_raw() for string/binary values, and rc_avpair_get_attr() to read the attribute type and ID. To iterate the list use rc_avpair_next(). Free the entire list with rc_avpair_free(). .sp .RS .nf \fB struct rc_value_pair { char \fIname\fP[RC_NAME_LENGTH+1]; // attribute name if known. uint64_t \fIattribute\fP; // attribute numeric value of type rc_attr_id including vendor; use VENDOR() and ATTRID() to separate. rc_attr_type \fItype\fP; // attribute type. uint32_t \fIlvalue\fP; // attribute value if type is PW_TYPE_INTEGER, PW_TYPE_DATE or PW_TYPE_IPADDR. char \fIstrvalue\fP[AUTH_STRING_LEN+1]; // contains attribute value in other cases. struct rc_value_pair *\fInext\fP; char \fIpad\fP[32]; // unused pad }; \fP .fi .RE .SH RETURN VALUE .PP OK_RC (0) on success, CHALLENGE_RC (3) on Access-Challenge, REJECT_RC (2) on Access-Reject, or a negative error code on failure. .SH SEE ALSO .PP .nh .ad l \fIrc_aaa\fP(3), \fIrc_aaa_ctx\fP(3), \fIrc_aaa_ctx_free\fP(3), \fIrc_aaa_ctx_get_secret\fP(3), \fIrc_aaa_ctx_get_vector\fP(3), \fIrc_acct\fP(3), \fIrc_acct_async\fP(3), \fIrc_acct_proxy\fP(3), \fIrc_add_config\fP(3), \fIrc_apply_config\fP(3), \fIrc_auth\fP(3), \fIrc_auth_proxy\fP(3), \fIrc_avpair_add\fP(3), \fIrc_avpair_assign\fP(3), \fIrc_avpair_copy\fP(3), \fIrc_avpair_free\fP(3), \fIrc_avpair_gen\fP(3), \fIrc_avpair_get\fP(3), \fIrc_avpair_get_attr\fP(3), \fIrc_avpair_get_in6\fP(3), \fIrc_avpair_get_raw\fP(3), \fIrc_avpair_get_uint32\fP(3), \fIrc_avpair_insert\fP(3), \fIrc_avpair_log\fP(3), \fIrc_avpair_new\fP(3), \fIrc_avpair_next\fP(3), \fIrc_avpair_parse\fP(3), \fIrc_avpair_remove\fP(3), \fIrc_avpair_tostr\fP(3), \fIrc_buildreq\fP(3), \fIrc_check\fP(3), \fIrc_conf_int\fP(3), \fIrc_conf_srv\fP(3), \fIrc_conf_str\fP(3), \fIrc_config_free\fP(3), \fIrc_config_init\fP(3), \fIrc_destroy\fP(3), \fIrc_dict_addattr\fP(3), \fIrc_dict_addval\fP(3), \fIrc_dict_addvend\fP(3), \fIrc_dict_findattr\fP(3), \fIrc_dict_findval\fP(3), \fIrc_dict_findvend\fP(3), \fIrc_dict_free\fP(3), \fIrc_dict_getattr\fP(3), \fIrc_dict_getval\fP(3), \fIrc_dict_getvend\fP(3), \fIrc_find_server_addr\fP(3), \fIrc_get_socket_type\fP(3), \fIrc_new\fP(3), \fIrc_read_config\fP(3), \fIrc_read_dictionary\fP(3), \fIrc_read_dictionary_from_buffer\fP(3), \fIrc_send_server\fP(3), \fIrc_test_config\fP(3) .ad .hy