]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
rename %client() to %request.client()
authorAlan T. DeKok <aland@freeradius.org>
Thu, 8 May 2025 17:50:55 +0000 (13:50 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 8 May 2025 18:19:30 +0000 (14:19 -0400)
the old name is still supported for compatibility

doc/antora/modules/reference/pages/raddb/mods-available/client.adoc
raddb/mods-available/client
src/modules/rlm_client/rlm_client.c
src/modules/rlm_perl/rlm_perl.c
src/tests/modules/client/xlat.unlang
src/tests/modules/perl/test.pl

index 20de856a91c2e13bc0c3fef31f5c2b81d2d88a8c..69c8ad15778f68bf79f23c7d45d99587e50893f8 100644 (file)
@@ -72,9 +72,9 @@ map client [<ipaddr>] {      // <1>
 
 [options="header,autowidth"]
 |===
-| XLAT                           | Description
-| `%client(<field>)`             | Expands to the named _field_ in the current client definition.
-| `%client(<field>, <ipaddr>)`   | Expands to the named _field_ in the client specified by _ipaddr_.
+| Function                               | Description
+| `%request.client(<field>)`             | Expands to the named _field_ in the current client definition.
+| `%request.client(<field>, <ipaddr>)`   | Expands to the named _field_ in the client specified by _ipaddr_.
 |===
 
 
index 6e907d95733942aed7f7fa348fa174c1b9137bad..3f64dbd845b4218a413dc6aa60f6681d4cbe0e10 100644 (file)
@@ -75,9 +75,9 @@
 #
 #  [options="header,autowidth"]
 #  |===
-#  | XLAT                           | Description
-#  | `%client(<field>)`             | Expands to the named _field_ in the current client definition.
-#  | `%client(<field>, <ipaddr>)`   | Expands to the named _field_ in the client specified by _ipaddr_.
+#  | Function                               | Description
+#  | `%request.client(<field>)`             | Expands to the named _field_ in the current client definition.
+#  | `%request.client(<field>, <ipaddr>)`   | Expands to the named _field_ in the client specified by _ipaddr_.
 #  |===
 #
 
index 44c8058856fefbf90d9bc477f0e5fd1b70c5b442..349df530e310b03072b486b8bc3298aa383aa8fd 100644 (file)
@@ -226,7 +226,7 @@ static xlat_arg_parser_t const xlat_client_args[] = {
  *
  * Example:
 @verbatim
-%client(foo, [<ipaddr>])
+%request.client(foo, [<ipaddr>])
 @endverbatim
  *
  * @ingroup xlat_functions
@@ -357,6 +357,9 @@ static int mod_load(void)
        if (unlikely((xlat = xlat_func_register(NULL, "client", xlat_client, FR_TYPE_STRING)) == NULL)) return -1;
        xlat_func_args_set(xlat, xlat_client_args);
 
+       if (unlikely((xlat = xlat_func_register(NULL, "request.client", xlat_client, FR_TYPE_STRING)) == NULL)) return -1;
+       xlat_func_args_set(xlat, xlat_client_args);
+
        map_proc_register(NULL, NULL, "client", map_proc_client, NULL, 0, FR_VALUE_BOX_SAFE_FOR_ANY);
 
        return 0;
index 89f37fe2ea815290215fb2d2f1fadb6b7f8d575a..b8167b0b3695a13938acbe8b1a137c49d2e09972 100644 (file)
@@ -235,7 +235,7 @@ static XS(XS_radiusd_log)
 /*
  *     This is a wrapper for xlat_aeval
  *     Now users are able to get data that is accessible only via xlat
- *     e.g. %client(...)
+ *     e.g. %request.client(...)
  *     Call syntax is radiusd::xlat(string), string will be handled as
  *     a double-quoted string in the configuration files.
  */
index 3277ebd0b92743ae879e3e38533076274a88cc5b..879501200bcfcdfded3b9c73334fcaabc0eaac00 100644 (file)
@@ -1,24 +1,24 @@
 string test_string
 
-test_string := "%client('nas_type')"
+test_string := "%request.client('nas_type')"
 
 if (test_string != 'a_type') {
         test_fail
 }
 
-test_string := "%client('nas_type',127.0.0.1)"
+test_string := "%request.client('nas_type',127.0.0.1)"
 
 if (test_string != 'a_type') {
         test_fail
 }
 
-test_string := "%client('nas_type',127.0.0.2)"
+test_string := "%request.client('nas_type',127.0.0.2)"
 
 if (test_string != 'b_type') {
         test_fail
 }
 
-test_string := "%client('nas_type',127.0.0.5)"
+test_string := "%request.client('nas_type',127.0.0.5)"
 
 if (test_string != 'b_type') {
        test_fail
@@ -27,12 +27,12 @@ if (test_string != 'b_type') {
 #
 #  Test non-existent client properties
 #
-test_string := "%client('non-existent-attr')"
+test_string := "%request.client('non-existent-attr')"
 if !(test_string == "") {
        test_fail
 }
 
-test_string := "%client('non-existing-attr2')"
+test_string := "%request.client('non-existing-attr2')"
 if !(test_string == "") {
        test_fail
 }
index d7bb2a23ce03da88faa3653d4b3379e8762a9949..b19cbb1f83cf84d982e27363627e3ff7e0c01aad 100644 (file)
@@ -71,7 +71,7 @@ sub authenticate {
                return RLM_MODULE_NOTFOUND;
        } else {
                # Accept user and set some attribute
-               if (&radiusd::xlat("%client(group)") eq 'UltraAllInclusive') {
+               if (&radiusd::xlat("%request.client(group)") eq 'UltraAllInclusive') {
                        # User called from NAS with unlim plan set, set higher limits
                        $RAD_REPLY{'Vendor-Specific'}{'Cisco'}{'h323-credit-amount'} = "1000000";
                        $RAD_REPLY{'Filter-Id'} = 'Everything'