]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
doxygen (xlat functions)
authorMatthew Newton <matthew-git@newtoncomputing.co.uk>
Wed, 26 Feb 2020 16:12:43 +0000 (16:12 +0000)
committerMatthew Newton <matthew-git@newtoncomputing.co.uk>
Wed, 26 Feb 2020 16:33:14 +0000 (16:33 +0000)
27 files changed:
src/lib/eap_aka_sim/xlat.c
src/lib/server/main_config.c
src/lib/server/xlat_builtin.c
src/lib/unlang/foreach.c
src/lib/unlang/interpret.c
src/modules/rlm_cache/rlm_cache.c
src/modules/rlm_cipher/rlm_cipher.c
src/modules/rlm_client/rlm_client.c
src/modules/rlm_date/rlm_date.c
src/modules/rlm_delay/rlm_delay.c
src/modules/rlm_dhcpv4/rlm_dhcpv4.c
src/modules/rlm_dict/rlm_dict.c
src/modules/rlm_escape/rlm_escape.c
src/modules/rlm_exec/rlm_exec.c
src/modules/rlm_expr/rlm_expr.c
src/modules/rlm_idn/rlm_idn.c
src/modules/rlm_json/rlm_json.c
src/modules/rlm_ldap/rlm_ldap.c
src/modules/rlm_mschap/rlm_mschap.c
src/modules/rlm_perl/rlm_perl.c
src/modules/rlm_redis/rlm_redis.c
src/modules/rlm_rest/rlm_rest.c
src/modules/rlm_soh/rlm_soh.c
src/modules/rlm_sql/rlm_sql.c
src/modules/rlm_unbound/rlm_unbound.c
src/modules/rlm_unpack/rlm_unpack.c
src/modules/rlm_yubikey/rlm_yubikey.c

index c92eda52921ed59ce45a1eb7f2284460ad619e48..bee966009e5203157ec588594366c549fb49ccb2 100644 (file)
@@ -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,
index 418e5b557ced499ca10e6f10d4e0fcfe894d064e..daa1bf0caa77dc11d1038ec3ed9f91e0b2ebdc32 100644 (file)
@@ -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,
index 7daab322fedcf6944872719c9e398b86d4d02a6b..446967771ccb60b08f464572d6aa750565722e5d 100644 (file)
@@ -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
  */
index 52d9440893378292b32d7d191118c0517cae1c0a..42db963afe8e0cf5bb87ba756abf12820587a5f4 100644 (file)
@@ -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,
index c3d7b5f15df9fb07d35395e60ac0bc3016841023..a5e0bf37ee707c8fd4a20fefd11f74e86224fd73 100644 (file)
@@ -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,
index e17cb14bb16a81833eac08c9e55bc17c8c48730b..a24c4fdc455e2ec30fa2a9a4a7c659865f4c27c5 100644 (file)
@@ -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,
index 093ab2f75b60d16b90de9b008353013482c7ab9a..7190b4a461c35df866660ced4f4a79075a0ef412 100644 (file)
@@ -457,7 +457,13 @@ static int cipher_rsa_certificate_file_load(TALLOC_CTX *ctx, void *out, UNUSED v
  *
  * Arguments are @verbatim(<plaintext>...)@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,
index 597ef2063090bbbc2011691a231a0bf609516560..3dd0fe151d3079ca0613039085840926d5fa50aa 100644 (file)
@@ -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,
index f38fb5505190c969d9d4d6c3996d40dd5f5551ea..f44bb3f0be35b25623fe54532a0332c7ebc5b55f 100644 (file)
@@ -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)
index 9c1194542823b18acdb391f7c3ad84ba643756e9..e3314c2d6995c3c034f7fb0173a4b66f7535c450 100644 (file)
@@ -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)
index 1b9d586943c536c72dce54082b7cf2a1d67af47c..c227a506ac3be3610a1fb08630ed1b1991420ed3 100644 (file)
@@ -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)
index e68c5f0a5f42c3f39c386dc65c79ffd59784fd99..daf0a03ff2b08b361da6ced25e4851b772d848ed 100644 (file)
@@ -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,
index 6d9fd8d2d27cb00e84584d7d58d7f051141c0d22..5aa2cc4403e8558d20917e5a6818f6b066864e55 100644 (file)
@@ -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,
index b8d9d6c9a46ac523fd5f26867e81a5aefde18c3a..a58491e03cd3d21c40d56e498d788e7b1a9cdc1f 100644 (file)
@@ -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,
index 9aaacbbfd57b16ced7e4e5edc6c669ad4f721141..945165c2bbd276b60f1c7a3db3eb6106922689cb 100644 (file)
@@ -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,
index 5a05caca1e1b91be517558bf71372be35f0b65a4..122b7119cf026713668014d77f64c54950d5ea70 100644 (file)
@@ -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)
index 2362532cef6be14b5a7ff7acd7acf56f9fa87310..67f98947114872f4d2d4f37abdeae7b18ca41908 100644 (file)
@@ -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
index 98c826e75d2cb5ed86268ee82866020480a44a14..04bbc7547299c636cfff4717cf36260f963ac497 100644 (file)
@@ -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;
index 9d81ca5fa76d0bd813459ad5d8e4c8e139ddde57..1b2fe340bcf449de19155338452620212a16becc 100644 (file)
@@ -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,
index 9ab4fe943ab05d3f9bd0d75814579c1a3f9c70cb..c44942f6fb79aa6385fb19cfa6c79e506182da59 100644 (file)
@@ -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,
index 84b3455762f551f5b499936e70531ee9d86755d0..2b8814c2a76a108b1dccb9d4cb22a6b3b1b793d4 100644 (file)
@@ -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)
index 59d769a8d1de2f31ceac1c08fc4fdba2f8457cb6..af5396ca47da7905eb40ebd22c809e011d5ebe4c 100644 (file)
@@ -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,
index 19a7495e2a3e874eddbd9487bc474a639d6f8a16..f7a8cac4f0f0371adfaae20f797be41e8fae201e 100644 (file)
@@ -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,
index e1ae9c7331abd385ee2e1cee342f23aad7dd646c..8c693cc8d1a07a3fa16fafeb5cbf770f217602a8 100644 (file)
@@ -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,
index 669965746c31ac039d0d9fb9ddf553001901135f..31d103e6ed79aea466047245105c42c57db9858b 100644 (file)
@@ -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)
index 4be8144ec7b4b8a3f3fecceb5c1b196bca8fe169..a444200277799c868f5fdb3a02733d574f98a8c4 100644 (file)
@@ -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,
index 7b04541c9a51e04de51e583e0b65f29b449e1aeb..78e51daf90a4c8d609963558396084201c129128 100644 (file)
@@ -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,