*
* Example:
@verbatim
-"%(debug:3)"
+%debug(3)
@endverbatim
*
* @ingroup xlat_functions
*
* Example:
@verbatim
-"%(debug_attr:&request[*])"
+%debug_attr(&request)
@endverbatim
*
* @ingroup xlat_functions
/** Split a string into multiple new strings based on a delimiter
*
@verbatim
-%(explode:<string> <delim>)
+%explode(<string>, <delim>)
@endverbatim
*
* Example:
update request {
&Tmp-String-1 := "a,b,c"
}
-"%(concat:%(explode:%{Tmp-String-1} ,) |)" == "a|b|c"
+"%concat(%explode(%{Tmp-String-1}, ','), '|')" == "a|b|c"
@endverbatim
*
* @ingroup xlat_functions
*
* Example:
@verbatim
-"%(immutable:&request.State[*])"
+%immutable(&request.State[*])
@endverbatim
*
* @ingroup xlat_functions
update request {
&Tmp-IP-Address-0 := "127.0.0.5"
}
-"%(integer:%{Tmp-IP-Address-0})" == 2130706437
+%integer(%{Tmp-IP-Address-0}) == 2130706437
@endverbatim
* @ingroup xlat_functions
*/
*
* e.g.
@verbatim
-%{map:&User-Name := 'foo'}
+%map("&User-Name := 'foo'")
@endverbatim
*
* Allows sets of modifications to be cached and then applied.
* Parse the input as a literal expansion
*/
if (xlat_tokenize(rctx,
- &rctx->ex,
+ &rctx->ex,
&FR_SBUFF_IN(arg->vb_strvalue, arg->vb_length),
&(fr_sbuff_parse_rules_t){
.escapes = &escape_rules
/** lpad a string
*
@verbatim
-%(rpad:&Attribute-Name <length> [<fill>])
+%lpad(%{Attribute-Name}, <length> [, <fill>])
@endverbatim
*
* Example: (User-Name = "foo")
@verbatim
-"%(rpad:%{User-Name} 5 x)" == "xxfoo"
+%lpad(%{User-Name}, 5 'x') == "xxfoo"
@endverbatim
*
* @ingroup xlat_functions
/** Right pad a string
*
@verbatim
-%(rpad:&Attribute-Name <length> [<fill>])
+%rpad(%{Attribute-Name}, <length> [, <fill>])
@endverbatim
*
* Example: (User-Name = "foo")
@verbatim
-"%(rpad:%{User-Name} 5 x)" == "fooxx"
+%rpad(%{User-Name}, 5 'x') == "fooxx"
@endverbatim
*
* @ingroup xlat_functions
*
* Example:
@verbatim
-"%(base64.encode:foo)" == "Zm9v"
+%base64.encode("foo") == "Zm9v"
@endverbatim
*
* @ingroup xlat_functions
*
* Example:
@verbatim
-"%(base64.decode:Zm9v)" == "foo"
+%base64.decode("Zm9v") == "foo"
@endverbatim
*
* @ingroup xlat_functions
*
* Example:
@verbatim
-"%{bin:666f6f626172}" == "foobar"
+%bin("666f6f626172") == "foobar"
@endverbatim
*
* @see #xlat_func_hex
*
* Example:
@verbatim
-%(cast:string %{request[*]}) results in all of the input boxes being cast to string/
+%cast('string', %{request[*]}) results in all of the input boxes being cast to string/
@endverbatim
*
* @ingroup xlat_functions
*
* Example:
@verbatim
-"%(concat:%{request.[*]} ,)" == "<attr1value>,<attr2value>,<attr3value>,..."
-"%(concat:%{Tmp-String-0[*]} '. ')" == "<str1value>. <str2value>. <str3value>. ..."
-"%(concat:%(join:%{User-Name} %{Calling-Station-Id}) ', ')" == "bob, aa:bb:cc:dd:ee:ff"
+%concat(%{request.[*]}, ',') == "<attr1value>,<attr2value>,<attr3value>,..."
+%concat(%{Tmp-String-0[*]}, '. ') == "<str1value>. <str2value>. <str3value>. ..."
+%concat(%join(%{User-Name}, %{Calling-Station-Id}), ', ') == "bob, aa:bb:cc:dd:ee:ff"
@endverbatim
*
* @ingroup xlat_functions
*
* Example:
@verbatim
-"%{hex:foobar}" == "666f6f626172"
+%hex("foobar") == "666f6f626172"
@endverbatim
*
* @see #xlat_func_bin
*
* Example:
@verbatim
-"%(hmacmd5:%{string:foo} %{string:bar})" == "0x31b6db9e5eb4addb42f1a6ca07367adc"
+%hmacmd5(%{string:foo}, %{string:bar}) == "0x31b6db9e5eb4addb42f1a6ca07367adc"
@endverbatim
*
* @ingroup xlat_functions
*
* Example:
@verbatim
-"%(hmacsha1:%{string:foo} %{string:bar})" == "0x85d155c55ed286a300bd1cf124de08d87e914f3a"
+%hmacsha1(%{string:foo}, %{string:bar}) == "0x85d155c55ed286a300bd1cf124de08d87e914f3a"
@endverbatim
*
* @ingroup xlat_functions
*
* Example:
@verbatim
-"%(length:foobar)" == 6
-"%(length:%{bin:0102030005060708})" == 8
+%length(foobar) == 6
+%length(%bin("0102030005060708")) == 8
@endverbatim
*
* @see #xlat_func_strlen
*
* Example:
@verbatim
-"%{md4:foo}" == "0ac6700c491d70fb8650940b1ca1e4b2"
+%md4("foo") == "0ac6700c491d70fb8650940b1ca1e4b2"
@endverbatim
*
* @ingroup xlat_functions
*
* Example:
@verbatim
-"%{md5:foo}" == "acbd18db4cc2f85cedef654fccc4a4d8"
+%md5("foo") == "acbd18db4cc2f85cedef654fccc4a4d8"
@endverbatim
*
* @ingroup xlat_functions
@verbatim
exec echo {
...
- program = "/bin/echo %{module:}"
+ program = "/bin/echo %module()"
...
}
@endverbatim
*
* Example:
@verbatim
-"%{module:}" == "" (outside a module)
-"%{module:}" == "ldap" (in the ldap module)
+%module() == "" (outside a module)
+%module() == "ldap" (in the ldap module)
@endverbatim
*
* @ingroup xlat_functions
*
* Example:
@verbatim
-"%{pack:%{Attr-Foo}%{Attr-bar}" == packed hex values of the attributes
+%pack(%{Attr-Foo}%{Attr-bar}) == packed hex values of the attributes
@endverbatim
*
* @ingroup xlat_functions
*
* Example:
@verbatim
-"%(pairs:request.[*])" == 'User-Name = "foo"User-Password = "bar"'
-"%(concat:%(pairs:request.[*]) ', ')" == 'User-Name = "foo", User-Password = "bar"'
+%pairs(request.[*]) == 'User-Name = "foo"User-Password = "bar"'
+%concat(%pairs(request.[*]), ', ') == 'User-Name = "foo", User-Password = "bar"'
@endverbatim
*
* @see #xlat_func_concat
/** Generate a random integer value
*
- * For "N = %{rand:MAX}", 0 <= N < MAX
+ * For "N = %rand(MAX)", 0 <= N < MAX
*
* Example:
@verbatim
-"%{rand:100}" == 42
+%rand(100) == 42
@endverbatim
*
* @ingroup xlat_functions
*
* Example:
@verbatim
-"%{randstr:CCCC!!cccnnn}" == "IPFL>{saf874"
-"%{randstr:42o}" == "yHdupUwVbdHprKCJRYfGbaWzVwJwUXG9zPabdGAhM9"
-"%{hex:%{randstr:bbbb}}" == "a9ce04f3"
-"%{hex:%{randstr:8b}}" == "fe165529f9f66839"
+%randstr("CCCC!!cccnnn") == "IPFL>{saf874"
+%randstr("42o") == "yHdupUwVbdHprKCJRYfGbaWzVwJwUXG9zPabdGAhM9"
+%hex(%randstr("bbbb")) == "a9ce04f3"
+%hex(%randstr("8b")) == "fe165529f9f66839"
@endverbatim
* @ingroup xlat_functions
*/
if ("foo" =~ /^(?<name>.*)/) {
noop
}
-"%{regex:name}" == "foo"
+%regex(name) == "foo"
@endverbatim
*
* @ingroup xlat_functions
*
* Example:
@verbatim
-"%{sha1:foo}" == "0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33"
+%sha1(foo) == "0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33"
@endverbatim
*
* @ingroup xlat_functions
*
* Example:
@verbatim
-"%{sha2_256:foo}" == "0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33"
+%sha2_256(foo) == "0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33"
@endverbatim
*
* @ingroup xlat_functions
*
* Example:
@verbatim
-"%{strlen:foo}" == 3
+%strlen(foo) == 3
@endverbatim
*
* @see #xlat_func_length
* Called when %(subst:) pattern begins with "/"
*
@verbatim
-%(subst:<subject> /<regex>/[flags] <replace>)
+%subst(<subject>, /<regex>/[flags], <replace>)
@endverbatim
*
* Example: (User-Name = "foo")
@verbatim
-"%(subst:%{User-Name} /oo.*$/ un)" == "fun"
+%subst(%{User-Name}, /oo.*$/, 'un') == "fun"
@endverbatim
*
* @see #xlat_func_subst
/** Perform regex substitution
*
@verbatim
-%(sub:<subject> <pattern> <replace>)
+%sub(<subject>, <pattern>, <replace>)
@endverbatim
*
* Example: (User-Name = "foobar")
@verbatim
-"%(sub:%{User-Name} oo un)" == "funbar"
+%sub(%{User-Name}, 'oo', 'un') == "funbar"
@endverbatim
*
* @see xlat_func_subst_regex
* Note that all operations are UTC.
*
@verbatim
-%(time:)
+%time()
@endverbatim
*
* Example:
@verbatim
update reply {
- &Reply-Message := "%{%{time:now} - %{time:request}}"
+ &Reply-Message := "%{%time(now) - %time(request)}"
}
@endverbatim
*
*
* Example:
@verbatim
-"%{tolower:Bar}" == "bar"
+%tolower("Bar") == "bar"
@endverbatim
*
* Probably only works for ASCII
*
* Example:
@verbatim
-"%{toupper:Foo}" == "FOO"
+%toupper("Foo") == "FOO"
@endverbatim
*
* Probably only works for ASCII
*
* Example:
@verbatim
-"%{urlquote:http://example.org/}" == "http%3A%47%47example.org%47"
+%urlquote("http://example.org/") == "http%3A%47%47example.org%47"
@endverbatim
*
* @ingroup xlat_functions
*
* Example:
@verbatim
-"%{urlunquote:http%%3A%%47%%47example.org%%47}" == "http://example.org/"
+%urlunquote("http%%3A%%47%%47example.org%%47") == "http://example.org/"
@endverbatim
*
* @ingroup xlat_functions
*
* Example:
@verbatim
-%(dhcpv4.decode:%{Tmp-Octets-0})
+%dhcpv4.decode(%{Tmp-Octets-0})
@endverbatim
*
* @ingroup xlat_functions
*
* Example:
@verbatim
-%(dhcpv4.encode:&request[*])
+%dhcpv4.encode(&request[*])
@endverbatim
*
* @ingroup xlat_functions