[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_.
|===
#
# [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_.
# |===
#
*
* Example:
@verbatim
-%client(foo, [<ipaddr>])
+%request.client(foo, [<ipaddr>])
@endverbatim
*
* @ingroup xlat_functions
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;
/*
* 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.
*/
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
#
# 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
}
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'