.\" File automatically generated by doxy2man0.3 .\" Generation date: Thu Sep 3 2026 .TH radcli_avp_concat_str 3 2026-09-03 "radcli" "Radius client library" .SH "NAME" radcli_avp_concat_str \- Concatenate every occurrence of an attribute into a bounded buffer. .SH SYNOPSIS .nf .B #include .sp \fBint radcli_avp_concat_str\fP( \fBchar *\fP\fIbuf\fP, \fBsize_t \fP\fIbuflen\fP, \fBconst radcli_avp_list *\fP\fIlist\fP, \fBconst radcli_attr_def *\fP\fIdef\fP, \fBconst char *\fP\fIsep\fP ); .fi .SH DESCRIPTION .PP Generalizes the one convenience legacy radcli.h's rc_aaa() folded into its own call signature (its msg parameter: "will contain the .PP concatenation of any PW_REPLY_MESSAGE received", lib/buildreq.c) to any attribute, since the pattern walk every occurrence of one attribute in a reply, join as text is not specific to Reply-Message. A caller wanting rc_aaa()'s old convenience no longer needs to hand-roll the radcli_avp_get()-in-a-loop this replaces. .PP If no occurrence of def is present in list, buf is set to an empty string and 0 is returned this is not a failure, the same way rc_aaa()'s msg started as '\0' and simply stayed that way when no Reply-Message arrived. An attribute whose value contains an embedded NUL byte, or (for a RADCLI_TYPE_TEXT attribute) invalid UTF-8, is skipped (radcli_avp_get_cstr()'s policy), not treated as a failure either. .PP Follows snprintf()'s buffer-sizing contract exactly: buf may be NULL and/or buflen may be 0 to size a buffer before allocating one (nothing is written in that case), and the return value is always the number of bytes the joined result would occupy, whether or not it fit a return >= buflen means the result was truncated, and buf (if non-NULL and buflen > 0) then holds only a valid NUL-terminated prefix of what fits, never garbage and never unterminated. .SH PARAMETERS .TP .B buf destination buffer, or NULL to only compute the needed size; always left NUL-terminated on return (including on truncation, containing whatever fit), whenever buf is non-NULL and buflen > 0. .TP .B buflen size of buf, in bytes; may be 0. .TP .B list the list to search. .TP .B def the attribute to concatenate occurrences of. .TP .B sep separator inserted between occurrences; NULL or "" for none. .SH RETURN VALUE .PP the number of bytes the joined result occupies (excluding the NUL terminator), whether or not it fit in buf or -1 if def is NULL. .SH SEE ALSO .PP .nh .ad l \fIradcli_avp_add_bytes\fP(3), \fIradcli_avp_add_bytes_by_num\fP(3), \fIradcli_avp_add_gigawords64\fP(3), \fIradcli_avp_add_gigawords64_by_num\fP(3), \fIradcli_avp_add_ip4\fP(3), \fIradcli_avp_add_ip4_by_num\fP(3), \fIradcli_avp_add_ip4prefix\fP(3), \fIradcli_avp_add_ip4prefix_by_num\fP(3), \fIradcli_avp_add_ip6\fP(3), \fIradcli_avp_add_ip6_by_num\fP(3), \fIradcli_avp_add_str\fP(3), \fIradcli_avp_add_str_by_num\fP(3), \fIradcli_avp_add_uint32\fP(3), \fIradcli_avp_add_uint32_by_num\fP(3), \fIradcli_avp_add_uint64\fP(3), \fIradcli_avp_add_uint64_by_num\fP(3), \fIradcli_avp_add_username\fP(3), \fIradcli_avp_concat_str_by_num\fP(3), \fIradcli_avp_def\fP(3), \fIradcli_avp_get\fP(3), \fIradcli_avp_get_by_num\fP(3), \fIradcli_avp_get_bytes\fP(3), \fIradcli_avp_get_bytes_by_num\fP(3), \fIradcli_avp_get_cstr\fP(3), \fIradcli_avp_get_cstr_by_num\fP(3), \fIradcli_avp_get_gigawords64\fP(3), \fIradcli_avp_get_gigawords64_by_num\fP(3), \fIradcli_avp_get_ip4prefix\fP(3), \fIradcli_avp_get_ip4prefix_by_num\fP(3), \fIradcli_avp_get_ip6\fP(3), \fIradcli_avp_get_ip6_by_num\fP(3), \fIradcli_avp_get_uint32\fP(3), \fIradcli_avp_get_uint32_by_num\fP(3), \fIradcli_avp_get_uint64\fP(3), \fIradcli_avp_get_uint64_by_num\fP(3), \fIradcli_avp_iter_next\fP(3), \fIradcli_avp_list_error\fP(3), \fIradcli_avp_list_free\fP(3), \fIradcli_avp_list_iter\fP(3), \fIradcli_avp_list_new\fP(3) .ad .hy