From: Matthew Newton Date: Wed, 26 Feb 2020 16:12:43 +0000 (+0000) Subject: doxygen (xlat functions) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df634992d6a56ec44be572ec2cd381f38b5c5af2;p=thirdparty%2Ffreeradius-server.git doxygen (xlat functions) --- diff --git a/src/lib/eap_aka_sim/xlat.c b/src/lib/eap_aka_sim/xlat.c index c92eda52921..bee966009e5 100644 --- a/src/lib/eap_aka_sim/xlat.c +++ b/src/lib/eap_aka_sim/xlat.c @@ -31,7 +31,11 @@ static int aka_sim_xlat_refs = 0; /** Returns the SIM method EAP-SIM or EAP-AKA hinted at by the user identifier * - * %{aka_sim_id_method:&id_attr} +@verbatim +%{aka_sim_id_method:&id_attr} +@endverbatim + * + * @ingroup xlat_functions */ static ssize_t aka_sim_xlat_id_method_xlat(TALLOC_CTX *ctx, char **out, UNUSED size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, @@ -102,7 +106,11 @@ static ssize_t aka_sim_xlat_id_method_xlat(TALLOC_CTX *ctx, char **out, UNUSED s /** Returns the type of identity used * - * %{aka_sim_id_type:&id_attr} +@verbatim +%{aka_sim_id_type:&id_attr} +@endverbatim + * + * @ingroup xlat_functions */ static ssize_t aka_sim_xlat_id_type_xlat(TALLOC_CTX *ctx, char **out, UNUSED size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, @@ -173,8 +181,11 @@ static ssize_t aka_sim_xlat_id_type_xlat(TALLOC_CTX *ctx, char **out, UNUSED siz /** Returns the key index from a 3gpp pseudonym * - * %{3gpp_pseudonym_key_index:&id_attr} +@verbatim +%{3gpp_pseudonym_key_index:&id_attr} +@endverbatim * + * @ingroup xlat_functions */ static ssize_t aka_sim_3gpp_pseudonym_key_index_xlat(TALLOC_CTX *ctx, char **out, UNUSED size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, @@ -220,6 +231,14 @@ static ssize_t aka_sim_3gpp_pseudonym_key_index_xlat(TALLOC_CTX *ctx, char **out return talloc_array_length(*out) - 1; } +/** Decrypt a 3gpp pseudonym + * +@verbatim +%{3gpp_pseudonym_decrypt:&id_attr &key_attr} +@endverbatim + * + * @ingroup xlat_functions + */ static ssize_t aka_sim_3gpp_pseudonym_decrypt_xlat(TALLOC_CTX *ctx, char **out, UNUSED size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt) @@ -327,8 +346,11 @@ static ssize_t aka_sim_3gpp_pseudonym_decrypt_xlat(TALLOC_CTX *ctx, char **out, /** Encrypts a 3gpp pseudonym * - * %{3gpp_pseudonym_encrypt:&id_attr &key_attr key_index} +@verbatim +%{3gpp_pseudonym_encrypt:&id_attr &key_attr key_index} +@endverbatim * + * @ingroup xlat_functions */ static ssize_t aka_sim_3gpp_pseudonym_encrypt_xlat(TALLOC_CTX *ctx, char **out, UNUSED size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, diff --git a/src/lib/server/main_config.c b/src/lib/server/main_config.c index 418e5b557ce..daa1bf0caa7 100644 --- a/src/lib/server/main_config.c +++ b/src/lib/server/main_config.c @@ -514,8 +514,13 @@ static size_t config_escape_func(UNUSED REQUEST *request, char *out, size_t outl return len; } -/* - * Xlat for %{config:section.subsection.attribute} +/** xlat to get config values + * +@verbatim +%{config:section.subsection.attribute} +@endverbatim + * + * @ingroup xlat_functions */ static ssize_t xlat_config(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, diff --git a/src/lib/server/xlat_builtin.c b/src/lib/server/xlat_builtin.c index 7daab322fed..446967771cc 100644 --- a/src/lib/server/xlat_builtin.c +++ b/src/lib/server/xlat_builtin.c @@ -529,6 +529,13 @@ typedef struct { } xlat_redundant_t; +/** xlat "redundant" processing + * + * Processes xlat calls for modules defined in "redundant" + * sub-sections of the instantiate configuration. + * + * @ingroup xlat_functions + */ static ssize_t xlat_redundant(TALLOC_CTX *ctx, char **out, NDEBUG_UNUSED size_t outlen, void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt) @@ -580,6 +587,13 @@ static ssize_t xlat_redundant(TALLOC_CTX *ctx, char **out, NDEBUG_UNUSED size_t } +/** xlat "load-balance" processing + * + * Processes xlat calls for modules defined in "load-balance" + * sub-sections of the instantiate configuration. + * + * @ingroup xlat_functions + */ static ssize_t xlat_load_balance(TALLOC_CTX *ctx, char **out, NDEBUG_UNUSED size_t outlen, void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt) @@ -2841,7 +2855,7 @@ static xlat_action_t xlat_func_sub_regex(TALLOC_CTX *ctx, fr_cursor_t *out, "%{sub:oo un %{User-Name}}" == "funbar" @endverbatim * - * @see #xlat_func_sub_regex + * @see xlat_func_sub_regex * * @ingroup xlat_functions */ diff --git a/src/lib/unlang/foreach.c b/src/lib/unlang/foreach.c index 52d94408933..42db963afe8 100644 --- a/src/lib/unlang/foreach.c +++ b/src/lib/unlang/foreach.c @@ -206,6 +206,7 @@ static unlang_action_t unlang_break(REQUEST *request, rlm_rcode_t *presult) /** Implements the Foreach-Variable-X * + * @ingroup xlat_functions */ static ssize_t unlang_foreach_xlat(TALLOC_CTX *ctx, char **out, UNUSED size_t outlen, void const *mod_inst, UNUSED void const *xlat_inst, diff --git a/src/lib/unlang/interpret.c b/src/lib/unlang/interpret.c index c3d7b5f15df..a5e0bf37ee7 100644 --- a/src/lib/unlang/interpret.c +++ b/src/lib/unlang/interpret.c @@ -1181,6 +1181,7 @@ void unlang_interpret_resumable(REQUEST *request) /** Get information about the interpreter state * + * @ingroup xlat_functions */ static ssize_t unlang_interpret_xlat(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, diff --git a/src/modules/rlm_cache/rlm_cache.c b/src/modules/rlm_cache/rlm_cache.c index e17cb14bb16..a24c4fdc455 100644 --- a/src/modules/rlm_cache/rlm_cache.c +++ b/src/modules/rlm_cache/rlm_cache.c @@ -805,6 +805,7 @@ finish: /** Allow single attribute values to be retrieved from the cache * + * @ingroup xlat_functions */ static ssize_t cache_xlat(TALLOC_CTX *ctx, char **out, UNUSED size_t freespace, void const *mod_inst, UNUSED void const *xlat_inst, diff --git a/src/modules/rlm_cipher/rlm_cipher.c b/src/modules/rlm_cipher/rlm_cipher.c index 093ab2f75b6..7190b4a461c 100644 --- a/src/modules/rlm_cipher/rlm_cipher.c +++ b/src/modules/rlm_cipher/rlm_cipher.c @@ -457,7 +457,13 @@ static int cipher_rsa_certificate_file_load(TALLOC_CTX *ctx, void *out, UNUSED v * * Arguments are @verbatim(...)@endverbatim * +@verbatim +%{<inst>_encrypt:<plaintext>...} +@endverbatim + * * If multiple arguments are provided they will be concatenated. + * + * @ingroup xlat_functions */ static xlat_action_t cipher_rsa_encrypt_xlat(TALLOC_CTX *ctx, fr_cursor_t *out, REQUEST *request, UNUSED void const *xlat_inst, void *xlat_thread_inst, @@ -529,7 +535,13 @@ static xlat_action_t cipher_rsa_encrypt_xlat(TALLOC_CTX *ctx, fr_cursor_t *out, * * Arguments are @verbatim(<plaintext>...)@endverbatim * +@verbatim +%{<inst>_sign:<plaintext>...} +@endverbatim + * * If multiple arguments are provided they will be concatenated. + * + * @ingroup xlat_functions */ static xlat_action_t cipher_rsa_sign_xlat(TALLOC_CTX *ctx, fr_cursor_t *out, REQUEST *request, void const *xlat_inst, void *xlat_thread_inst, @@ -623,7 +635,13 @@ static xlat_action_t cipher_rsa_sign_xlat(TALLOC_CTX *ctx, fr_cursor_t *out, * * Arguments are @verbatim(<ciphertext\>...)@endverbatim * +@verbatim +%{<inst>_decrypt:<ciphertext>...} +@endverbatim + * * If multiple arguments are provided they will be concatenated. + * + * @ingroup xlat_functions */ static xlat_action_t cipher_rsa_decrypt_xlat(TALLOC_CTX *ctx, fr_cursor_t *out, REQUEST *request, UNUSED void const *xlat_inst, void *xlat_thread_inst, @@ -696,8 +714,14 @@ static xlat_action_t cipher_rsa_decrypt_xlat(TALLOC_CTX *ctx, fr_cursor_t *out, * * Arguments are @verbatim(<signature>, <plaintext>...)@endverbatim * +@verbatim +%{<inst>_verify:<signature> <plaintext>...} +@endverbatim + * * If multiple arguments are provided (after @verbatim<signature>@endverbatim) * they will be concatenated. + * + * @ingroup xlat_functions */ static xlat_action_t cipher_rsa_verify_xlat(TALLOC_CTX *ctx, fr_cursor_t *out, REQUEST *request, void const *xlat_inst, void *xlat_thread_inst, diff --git a/src/modules/rlm_client/rlm_client.c b/src/modules/rlm_client/rlm_client.c index 597ef206309..3dd0fe151d3 100644 --- a/src/modules/rlm_client/rlm_client.c +++ b/src/modules/rlm_client/rlm_client.c @@ -208,8 +208,14 @@ finish: return rcode; } -/* - * Xlat for %{client:[<ipaddr>.]foo} +/** xlat to get client config data + * + * Example: +@verbatim +%{client:[<ipaddr>.]foo} +@endverbatim + * + * @ingroup xlat_functions */ static ssize_t xlat_client(TALLOC_CTX *ctx, char **out, UNUSED size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, diff --git a/src/modules/rlm_date/rlm_date.c b/src/modules/rlm_date/rlm_date.c index f38fb550519..f44bb3f0be3 100644 --- a/src/modules/rlm_date/rlm_date.c +++ b/src/modules/rlm_date/rlm_date.c @@ -83,6 +83,31 @@ static ssize_t date_encode_strftime(char **out, size_t outlen, rlm_date_t const } DIAG_ON(format-nonliteral) +/** Get or convert time and date + * + * Using the format in the module instance configuration, get + * various timestamps, or convert strings to date format. + * + * When the request arrived: +@verbatim +%{date:request} +@endverbatim + * + * Now: +@verbatim +%{date:now} +@endverbatim + * + * Examples (Tmp-Integer-0 = 1506101100): +@verbatim +update request { + &Tmp-String-0 := "%{date:&Tmp-Integer-0}" ("Fri 22 Sep 18:25:00 BST 2017") + &Tmp-Integer-1 := "%{date:&Tmp-String-0}" (1506101100) +} +@endverbatim + * + * @ingroup xlat_functions + */ static ssize_t xlat_date_convert(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen, void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt) diff --git a/src/modules/rlm_delay/rlm_delay.c b/src/modules/rlm_delay/rlm_delay.c index 9c119454282..e3314c2d699 100644 --- a/src/modules/rlm_delay/rlm_delay.c +++ b/src/modules/rlm_delay/rlm_delay.c @@ -220,6 +220,15 @@ static void xlat_delay_cancel(REQUEST *request, UNUSED void *instance, UNUSED vo if (!fr_cond_assert(unlang_xlat_event_timeout_delete(request, rctx) == 0)) return; } +/** Xlat to delay the request + * + * Example (delay 2 seconds): +@verbatim +"%{delay:2}" +@endverbatim + * + * @ingroup xlat_functions + */ static xlat_action_t xlat_delay(TALLOC_CTX *ctx, UNUSED fr_cursor_t *out, REQUEST *request, void const *xlat_inst, UNUSED void *xlat_thread_inst, fr_value_box_t **in) diff --git a/src/modules/rlm_dhcpv4/rlm_dhcpv4.c b/src/modules/rlm_dhcpv4/rlm_dhcpv4.c index 1b9d586943c..c227a506ac3 100644 --- a/src/modules/rlm_dhcpv4/rlm_dhcpv4.c +++ b/src/modules/rlm_dhcpv4/rlm_dhcpv4.c @@ -50,6 +50,17 @@ typedef struct { int nothing; } rlm_dhcpv4_t; +/** Decode DHCP option data + * + * Creates DHCP attributes based on the given binary option data + * + * Example: +@verbatim +%{dhcpv4_decode:%{Tmp-Octets-0}} +@endverbatim + * + * @ingroup xlat_functions + */ static xlat_action_t dhcpv4_decode_xlat(TALLOC_CTX *ctx, fr_cursor_t *out, REQUEST *request, UNUSED void const *xlat_inst, UNUSED void *xlat_thread_inst, fr_value_box_t **in) @@ -119,6 +130,17 @@ static xlat_action_t dhcpv4_decode_xlat(TALLOC_CTX *ctx, fr_cursor_t *out, return XLAT_ACTION_DONE; } +/** Encode DHCP option data + * + * Returns octet string created from the provided DHCP attributes + * + * Example: +@verbatim +%{dhcpv4_encode:&request:[*]} +@endverbatim + * + * @ingroup xlat_functions + */ static xlat_action_t dhcpv4_encode_xlat(TALLOC_CTX *ctx, fr_cursor_t *out, REQUEST *request, UNUSED void const *xlat_inst, UNUSED void *xlat_thread_inst, fr_value_box_t **in) diff --git a/src/modules/rlm_dict/rlm_dict.c b/src/modules/rlm_dict/rlm_dict.c index e68c5f0a5f4..daf0a03ff2b 100644 --- a/src/modules/rlm_dict/rlm_dict.c +++ b/src/modules/rlm_dict/rlm_dict.c @@ -27,8 +27,9 @@ RCSID("$Id$") #include <freeradius-devel/server/module.h> #include <freeradius-devel/server/rad_assert.h> -/* - * Xlat for %{attr_by_num:<number>} +/** Xlat for %{attr_by_num:\<number\>} + * + * @ingroup xlat_functions */ static ssize_t xlat_dict_attr_by_num(TALLOC_CTX *ctx, char **out, UNUSED size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, @@ -57,8 +58,9 @@ static ssize_t xlat_dict_attr_by_num(TALLOC_CTX *ctx, char **out, UNUSED size_t return talloc_array_length(*out) - 1; } -/* - * Xlat for %{attr_by_oid:<oid>} +/** Xlat for %{attr_by_oid:\<oid\>} + * + * @ingroup xlat_functions */ static ssize_t xlat_dict_attr_by_oid(TALLOC_CTX *ctx, char **out, UNUSED size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, @@ -84,6 +86,7 @@ static ssize_t xlat_dict_attr_by_oid(TALLOC_CTX *ctx, char **out, UNUSED size_t /** Return the vendor of an attribute reference * + * @ingroup xlat_functions */ static ssize_t xlat_vendor(TALLOC_CTX *ctx, char **out, UNUSED size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, @@ -105,6 +108,7 @@ static ssize_t xlat_vendor(TALLOC_CTX *ctx, char **out, UNUSED size_t outlen, /** Return the vendor number of an attribute reference * + * @ingroup xlat_functions */ static ssize_t xlat_vendor_num(TALLOC_CTX *ctx, char **out, UNUSED size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, @@ -122,6 +126,7 @@ static ssize_t xlat_vendor_num(TALLOC_CTX *ctx, char **out, UNUSED size_t outlen /** Return the attribute name of an attribute reference * + * @ingroup xlat_functions */ static ssize_t xlat_attr(TALLOC_CTX *ctx, char **out, size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, @@ -140,6 +145,7 @@ static ssize_t xlat_attr(TALLOC_CTX *ctx, char **out, size_t outlen, /** Return the attribute number of an attribute reference * + * @ingroup xlat_functions */ static ssize_t xlat_attr_num(TALLOC_CTX *ctx, char **out, UNUSED size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, diff --git a/src/modules/rlm_escape/rlm_escape.c b/src/modules/rlm_escape/rlm_escape.c index 6d9fd8d2d27..5aa2cc4403e 100644 --- a/src/modules/rlm_escape/rlm_escape.c +++ b/src/modules/rlm_escape/rlm_escape.c @@ -48,7 +48,12 @@ static char const hextab[] = "0123456789abcdef"; /** Equivalent to the old safe_characters functionality in rlm_sql but with utf8 support * - * @verbatim Example: "%{escape:<img>foo.jpg</img>}" == "=60img=62foo.jpg=60/img=62" @endverbatim + * Example: +@verbatim +"%{escape:<img>foo.jpg</img>}" == "=60img=62foo.jpg=60/img=62" +@endverbatim + * + * @ingroup xlat_functions */ static ssize_t escape_xlat(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen, void const *mod_inst, UNUSED void const *xlat_inst, @@ -115,7 +120,12 @@ static ssize_t escape_xlat(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen, /** Equivalent to the old safe_characters functionality in rlm_sql * - * @verbatim Example: "%{unescape:=60img=62foo.jpg=60/img=62}" == "<img>foo.jpg</img>" @endverbatim + * Example: +@verbatim +"%{unescape:=60img=62foo.jpg=60/img=62}" == "<img>foo.jpg</img>" +@endverbatim + * + * @ingroup xlat_functions */ static ssize_t unescape_xlat(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, diff --git a/src/modules/rlm_exec/rlm_exec.c b/src/modules/rlm_exec/rlm_exec.c index b8d9d6c9a46..a58491e03cd 100644 --- a/src/modules/rlm_exec/rlm_exec.c +++ b/src/modules/rlm_exec/rlm_exec.c @@ -141,8 +141,14 @@ static rlm_rcode_t rlm_exec_status2rcode(REQUEST *request, char *answer, size_t return status; } -/* - * Do xlat of strings. +/** Exec programs from an xlat + * + * Example: +@verbatim +"%{exec:/bin/echo hello}" == "hello" +@endverbatim + * + * @ingroup xlat_functions */ static ssize_t exec_xlat(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen, void const *mod_inst, UNUSED void const *xlat_inst, diff --git a/src/modules/rlm_expr/rlm_expr.c b/src/modules/rlm_expr/rlm_expr.c index 9aaacbbfd57..945165c2bbd 100644 --- a/src/modules/rlm_expr/rlm_expr.c +++ b/src/modules/rlm_expr/rlm_expr.c @@ -502,8 +502,14 @@ redo: goto redo; } -/* - * Do xlat of strings! +/** Xlat expressions + * + * Example (NAS-Port = 1): +@verbatim +"%{expr:2 + 3 + &NAS-Port}" == 6 +@endverbatim + * + * @ingroup xlat_functions */ static ssize_t expr_xlat(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, diff --git a/src/modules/rlm_idn/rlm_idn.c b/src/modules/rlm_idn/rlm_idn.c index 5a05caca1e1..122b7119cf0 100644 --- a/src/modules/rlm_idn/rlm_idn.c +++ b/src/modules/rlm_idn/rlm_idn.c @@ -87,6 +87,14 @@ static const CONF_PARSER mod_config[] = { CONF_PARSER_TERMINATOR }; +/** Convert domain name to ASCII punycode + * +@verbatim +%{idn:<domain>} +@endverbatim + * + * @ingroup xlat_functions + */ static ssize_t xlat_idna(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen, void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt) diff --git a/src/modules/rlm_json/rlm_json.c b/src/modules/rlm_json/rlm_json.c index 2362532cef6..67f98947114 100644 --- a/src/modules/rlm_json/rlm_json.c +++ b/src/modules/rlm_json/rlm_json.c @@ -83,6 +83,8 @@ typedef struct { } rlm_json_jpath_to_eval_t; /** Ensure contents are quoted correctly for a JSON document + * + * @ingroup xlat_functions * * @param ctx talloc context * @param out Where to write the output @@ -129,6 +131,8 @@ static xlat_action_t json_quote_xlat(TALLOC_CTX *ctx, fr_cursor_t *out, REQUEST } /** Determine if a jpath expression is valid + * + * @ingroup xlat_functions * * @param ctx to allocate expansion buffer in. * @param mod_inst data. @@ -166,6 +170,8 @@ static ssize_t jpath_validate_xlat(UNUSED TALLOC_CTX *ctx, char **out, size_t ou * * Usage is `%{json_encode:attr tmpl list}` * + * @ingroup xlat_functions + * * @param ctx talloc context * @param out where to write the output * @param request the current request diff --git a/src/modules/rlm_ldap/rlm_ldap.c b/src/modules/rlm_ldap/rlm_ldap.c index 98c826e75d2..04bbc754729 100644 --- a/src/modules/rlm_ldap/rlm_ldap.c +++ b/src/modules/rlm_ldap/rlm_ldap.c @@ -259,6 +259,11 @@ fr_dict_attr_autoload_t rlm_ldap_dict_attr[] = { { NULL } }; + +/** Escape LDAP string + * + * @ingroup xlat_functions + */ static ssize_t ldap_escape_xlat(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt) @@ -266,6 +271,10 @@ static ssize_t ldap_escape_xlat(UNUSED TALLOC_CTX *ctx, char **out, size_t outle return fr_ldap_escape_func(request, *out, outlen, fmt, NULL); } +/** Unescape LDAP string + * + * @ingroup xlat_functions + */ static ssize_t ldap_unescape_xlat(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt) @@ -275,6 +284,7 @@ static ssize_t ldap_unescape_xlat(UNUSED TALLOC_CTX *ctx, char **out, size_t out /** Expand an LDAP URL into a query, and return a string result from that query. * + * @ingroup xlat_functions */ static ssize_t ldap_xlat(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen, void const *mod_inst, UNUSED void const *xlat_inst, @@ -290,7 +300,7 @@ static ssize_t ldap_xlat(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen, struct berval **values; - fr_ldap_connection_t *conn; + fr_ldap_connection_t *conn; int ldap_errno; char const *url; diff --git a/src/modules/rlm_mschap/rlm_mschap.c b/src/modules/rlm_mschap/rlm_mschap.c index 9d81ca5fa76..1b2fe340bcf 100644 --- a/src/modules/rlm_mschap/rlm_mschap.c +++ b/src/modules/rlm_mschap/rlm_mschap.c @@ -284,11 +284,12 @@ static int pdb_decode_acct_ctrl(char const *p) } -/* - * Does dynamic translation of strings. +/** Get data from MSCHAP attributes + * + * Pulls NT-Response, LM-Response, or Challenge from MSCHAP + * attributes. * - * Pulls NT-Response, LM-Response, or Challenge from MSCHAP - * attributes. + * @ingroup xlat_functions */ static ssize_t mschap_xlat(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen, void const *mod_inst, UNUSED void const *xlat_inst, diff --git a/src/modules/rlm_perl/rlm_perl.c b/src/modules/rlm_perl/rlm_perl.c index 9ab4fe943ab..c44942f6fb7 100644 --- a/src/modules/rlm_perl/rlm_perl.c +++ b/src/modules/rlm_perl/rlm_perl.c @@ -364,8 +364,9 @@ static void xs_init(pTHX) newXS("radiusd::xlat",XS_radiusd_xlat, "rlm_perl"); } -/* - * The xlat function +/** Call perl code using an xlat + * + * @ingroup xlat_functions */ static ssize_t perl_xlat(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen, void const *mod_inst, UNUSED void const *xlat_inst, diff --git a/src/modules/rlm_redis/rlm_redis.c b/src/modules/rlm_redis/rlm_redis.c index 84b3455762f..2b8814c2a76 100644 --- a/src/modules/rlm_redis/rlm_redis.c +++ b/src/modules/rlm_redis/rlm_redis.c @@ -148,6 +148,14 @@ static int redis_xlat_instantiate(void *xlat_inst, UNUSED xlat_exp_t const *exp, return 0; } +/** Force a redis cluster remap + * +@verbatim +%{redis_remap:<redis server ip>:<redis server port>} +@endverbatim + * + * @ingroup xlat_functions + */ static xlat_action_t redis_remap_xlat(TALLOC_CTX *ctx, fr_cursor_t *out, REQUEST *request, void const *xlat_inst, UNUSED void *xlat_thread_inst, @@ -201,7 +209,7 @@ static xlat_action_t redis_remap_xlat(TALLOC_CTX *ctx, fr_cursor_t *out, /** Return the node that is currently servicing a particular key * - * + * @ingroup xlat_functions */ static xlat_action_t redis_node_xlat(TALLOC_CTX *ctx, fr_cursor_t *out, REQUEST *request, void const *xlat_inst, @@ -271,6 +279,15 @@ static xlat_action_t redis_node_xlat(TALLOC_CTX *ctx, fr_cursor_t *out, return XLAT_ACTION_DONE; } + +/** Xlat to make calls to redis + * +@verbatim +%{redis:<redis command>} +@endverbatim + * + * @ingroup xlat_functions + */ static ssize_t redis_xlat(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen, void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt) diff --git a/src/modules/rlm_rest/rlm_rest.c b/src/modules/rlm_rest/rlm_rest.c index 59d769a8d1d..af5396ca47d 100644 --- a/src/modules/rlm_rest/rlm_rest.c +++ b/src/modules/rlm_rest/rlm_rest.c @@ -310,8 +310,14 @@ finish: return xa; } -/* - * Simple xlat to read text data from a URL +/** Simple xlat to read text data from a URL + * + * Example: +@verbatim +%{rest:http://example.com/} +@endverbatim + * + * @ingroup xlat_functions */ static xlat_action_t rest_xlat(TALLOC_CTX *ctx, UNUSED fr_cursor_t *out, REQUEST *request, UNUSED void const *xlat_inst, void *xlat_thread_inst, diff --git a/src/modules/rlm_soh/rlm_soh.c b/src/modules/rlm_soh/rlm_soh.c index 19a7495e2a3..f7a8cac4f0f 100644 --- a/src/modules/rlm_soh/rlm_soh.c +++ b/src/modules/rlm_soh/rlm_soh.c @@ -69,8 +69,11 @@ fr_dict_attr_autoload_t rlm_soh_dict_attr[] = { { NULL } }; -/* +/** SoH xlat + * * Not sure how to make this useful yet... + * + * @ingroup xlat_functions */ static ssize_t soh_xlat(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, diff --git a/src/modules/rlm_sql/rlm_sql.c b/src/modules/rlm_sql/rlm_sql.c index e1ae9c7331a..8c693cc8d1a 100644 --- a/src/modules/rlm_sql/rlm_sql.c +++ b/src/modules/rlm_sql/rlm_sql.c @@ -160,9 +160,15 @@ static size_t sql_escape_func(REQUEST *, char *out, size_t outlen, char const *i /** Execute an arbitrary SQL query * - * For selects the first value of the first column will be returned, - * for inserts, updates and deletes the number of rows affected will be - * returned instead. + * For SELECTs, the first value of the first column will be returned. + * For INSERTS, UPDATEs and DELETEs, the number of rows affected will + * be returned instead. + * +@verbatim +%{sql:<sql statement>} +@endverbatim + * + * @ingroup xlat_functions */ static ssize_t sql_xlat(UNUSED TALLOC_CTX *ctx, char **out, UNUSED size_t outlen, void const *mod_inst, UNUSED void const *xlat_inst, diff --git a/src/modules/rlm_unbound/rlm_unbound.c b/src/modules/rlm_unbound/rlm_unbound.c index 669965746c3..31d103e6ed7 100644 --- a/src/modules/rlm_unbound/rlm_unbound.c +++ b/src/modules/rlm_unbound/rlm_unbound.c @@ -208,6 +208,10 @@ static int ub_common_fail(REQUEST *request, char const *name, struct ub_result * return 0; } +/** Perform a DNS lookup for an A record + * + * @ingroup xlat_functions + */ static ssize_t xlat_a(TALLOC_CTX *ctx, char **out, size_t outlen, void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt) @@ -255,6 +259,10 @@ static ssize_t xlat_a(TALLOC_CTX *ctx, char **out, size_t outlen, return -1; } +/** Perform a DNS lookup for an AAAA record + * + * @ingroup xlat_functions + */ static ssize_t xlat_aaaa(TALLOC_CTX *ctx, char **out, size_t outlen, void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt) @@ -321,6 +329,10 @@ static xlat_action_t xlat_ptr(TALLOC_CTX *ctx, fr_cursor_t *out, } */ +/** Perform a DNS lookup for a PTR record + * + * @ingroup xlat_functions + */ static ssize_t xlat_ptr(TALLOC_CTX *ctx, char **out, size_t outlen, void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt) diff --git a/src/modules/rlm_unpack/rlm_unpack.c b/src/modules/rlm_unpack/rlm_unpack.c index 4be8144ec7b..a4442002777 100644 --- a/src/modules/rlm_unpack/rlm_unpack.c +++ b/src/modules/rlm_unpack/rlm_unpack.c @@ -48,9 +48,13 @@ fr_dict_attr_autoload_t rlm_unpack_dict_attr[] = { /** Unpack data * - * Example: %{unpack:&Class 0 integer} + * Example: +@verbatim +%{unpack:&Class 0 integer} +@endverbatim + * Expands Class, treating octet at offset 0 (bytes 0-3) as an "integer". * - * Expands Class, treating octet at offset 0 (bytes 0-3) as an "integer". + * @ingroup xlat_functions */ static ssize_t unpack_xlat(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, diff --git a/src/modules/rlm_yubikey/rlm_yubikey.c b/src/modules/rlm_yubikey/rlm_yubikey.c index 7b04541c9a5..78e51daf90a 100644 --- a/src/modules/rlm_yubikey/rlm_yubikey.c +++ b/src/modules/rlm_yubikey/rlm_yubikey.c @@ -125,10 +125,14 @@ static ssize_t modhex2hex(char const *modhex, uint8_t *hex, size_t len) return i; } -/** - * @brief Convert Yubikey modhex to standard hex +/** Xlat to convert Yubikey modhex to standard hex + * + * Example: +@verbatim +"%{modhextohex:vvrbuctetdhc}" == "ffc1e0d3d260" +@endverbatim * - * Example: "%{modhextohex:vvrbuctetdhc}" == "ffc1e0d3d260" + * @ingroup xlat_functions */ static ssize_t modhex_to_hex_xlat(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst,