]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
rename xlat functions.
authorAlan T. DeKok <aland@freeradius.org>
Fri, 25 Apr 2025 15:44:06 +0000 (11:44 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 25 Apr 2025 19:16:28 +0000 (15:16 -0400)
via scripts, with some manual fixes to the unit tests.  Changing the length of an xlat
function changes the offset in a string where an error occurs.

perl -p -i -e 's/%concat\(/%str.concat\(/g' $(git grep -l 'concat' doc/antora raddb src/tests)
perl -p -i -e 's/%explode\(/%str.split\(/g' $(git grep -l 'explode' doc/antora raddb src/tests)
perl -p -i -e 's/%hmacmd5\(/%hmac.md5\(/g' $(git grep -l 'hmacmd5' doc/antora raddb src/tests)
perl -p -i -e 's/%hmacmd4\(/%hmac.md4\(/g' $(git grep -l 'hmacmd4' doc/antora raddb src/tests)
perl -p -i -e 's/%hmacsha1\(/%hmac.sha1\(/g' $(git grep -l 'hmacsha1' doc/antora raddb src/tests)
perl -p -i -e 's/%lpad\(/%str.lpad\(/g' $(git grep -l 'lpad' doc/antora raddb src/tests)
perl -p -i -e 's/%rpad\(/%str.rpad\(/g' $(git grep -l 'rpad' doc/antora raddb src/tests)
perl -p -i -e 's/%substr\(/%str.substr\(/g' $(git grep -l 'substr' doc/antora raddb src/tests)
perl -p -i -e 's/%randstr\(/%str.rand\(/g' $(git grep -l 'randstr' doc/antora raddb src/tests)
perl -p -i -e 's/%md4\(/%hash.md4\(/g' $(git grep -l 'md4' doc/antora raddb src/tests)
perl -p -i -e 's/%md5\(/%hash.md5\(/g' $(git grep -l 'md5' doc/antora raddb src/tests)
perl -p -i -e 's/%sha2_224\(/%hash.sha2_224\(/g' $(git grep -l 'sha2_224' doc/antora raddb src/tests)
perl -p -i -e 's/%sha2_256\(/%hash.sha2_256\(/g' $(git grep -l 'sha2_256' doc/antora raddb src/tests)
perl -p -i -e 's/%sha2_384\(/%hash.sha2_384\(/g' $(git grep -l 'sha2_384' doc/antora raddb src/tests)
perl -p -i -e 's/%sha2_512\(/%hash.sha2_512\(/g' $(git grep -l 'sha2_512' doc/antora raddb src/tests)
perl -p -i -e 's/%blake2s_256\(/%hash.blake2s_256\(/g' $(git grep -l 'blake2s_256' doc/antora raddb src/tests)
perl -p -i -e 's/%blake2b_512\(/%hash.blake2b_512\(/g' $(git grep -l 'blake2b_512' doc/antora raddb src/tests)
perl -p -i -e 's/%sha3_224\(/%hash.sha3_224\(/g' $(git grep -l 'sha3_224' doc/antora raddb src/tests)
perl -p -i -e 's/%sha3_256\(/%hash.sha3_256\(/g' $(git grep -l 'sha3_256' doc/antora raddb src/tests)
perl -p -i -e 's/%sha3_384\(/%hash.sha3_384\(/g' $(git grep -l 'sha3_384' doc/antora raddb src/tests)
perl -p -i -e 's/%sha3_512\(/%hash.sha3_512\(/g' $(git grep -l 'sha3_512' doc/antora raddb src/tests)
perl -p -i -e 's/%tolower\(/%str.lower\(/g' $(git grep -l 'tolower' doc/antora raddb src/tests)
perl -p -i -e 's/%toupper\(/%str.upper\(/g' $(git grep -l 'toupper' doc/antora raddb src/tests)
perl -p -i -e 's/%urlquote\(/%url.quote\(/g' $(git grep -l 'urlquote' doc/antora raddb src/tests)
perl -p -i -e 's/%urlunquote\(/%url.unquote\(/g' $(git grep -l 'urlunquote' doc/antora raddb src/tests)

81 files changed:
doc/antora/modules/ROOT/pages/index.adoc
doc/antora/modules/howto/pages/installation/upgrade.adoc
doc/antora/modules/reference/pages/raddb/mods-available/cache.adoc
doc/antora/modules/reference/pages/raddb/mods-available/rest.adoc
doc/antora/modules/reference/pages/raddb/sites-available/challenge.adoc
doc/antora/modules/reference/pages/raddb/sites-available/coa-relay.adoc
doc/antora/modules/reference/pages/raddb/sites-available/default.adoc
doc/antora/modules/reference/pages/raddb/sites-available/eap-aka-sim.adoc
doc/antora/modules/reference/pages/raddb/sites-available/ldap_sync.adoc
doc/antora/modules/reference/pages/type/cast.adoc
doc/antora/modules/reference/pages/xlat/concat.adoc
doc/antora/modules/reference/pages/xlat/conversion.adoc
doc/antora/modules/reference/pages/xlat/dict.adoc
doc/antora/modules/reference/pages/xlat/explode.adoc
doc/antora/modules/reference/pages/xlat/function.adoc
doc/antora/modules/reference/pages/xlat/hash.adoc
doc/antora/modules/reference/pages/xlat/lpad.adoc
doc/antora/modules/reference/pages/xlat/randstr.adoc
doc/antora/modules/reference/pages/xlat/rpad.adoc
doc/antora/modules/reference/pages/xlat/tolower.adoc
doc/antora/modules/reference/pages/xlat/toupper.adoc
raddb/mods-available/cache
raddb/mods-available/rest
raddb/policy.d/accounting
raddb/policy.d/canonicalisation
raddb/policy.d/cui
raddb/policy.d/filter
raddb/sites-available/challenge
raddb/sites-available/coa-relay
raddb/sites-available/default
raddb/sites-available/eap-aka-sim
raddb/sites-available/ldap_sync
src/tests/keywords/acct_unique
src/tests/keywords/alternation-error
src/tests/keywords/concat
src/tests/keywords/edit-multivalue
src/tests/keywords/expr-double
src/tests/keywords/filter_password
src/tests/keywords/foreach-error
src/tests/keywords/foreach-explode
src/tests/keywords/foreach-explode-key
src/tests/keywords/if-function
src/tests/keywords/join
src/tests/keywords/map-arg3-xlat
src/tests/keywords/map-csv-lhs
src/tests/keywords/md4
src/tests/keywords/md5
src/tests/keywords/md5-error
src/tests/keywords/pad
src/tests/keywords/pairs
src/tests/keywords/pap-ssha2
src/tests/keywords/radius.conf
src/tests/keywords/randstr
src/tests/keywords/sha1
src/tests/keywords/sha1-error
src/tests/keywords/sha2
src/tests/keywords/substr
src/tests/keywords/switch-escape
src/tests/keywords/tolower
src/tests/keywords/toupper
src/tests/keywords/urlquote
src/tests/keywords/xlat-attr-index
src/tests/keywords/xlat-escape
src/tests/keywords/xlat-explode
src/tests/keywords/xlat-list
src/tests/keywords/xlat-redundant
src/tests/ldap_sync/rfc4533/config/radiusd.conf
src/tests/modules/exec/module.conf
src/tests/modules/files/authorize
src/tests/modules/ldap/module.conf
src/tests/modules/pap/bin_random.unlang
src/tests/modules/redis/cluster_key.unlang
src/tests/modules/redis/cluster_reset.inc
src/tests/unit/condition/base.txt
src/tests/unit/condition/regex.txt
src/tests/unit/xlat/base.txt
src/tests/unit/xlat/cond_base.txt
src/tests/unit/xlat/expr.txt
src/tests/unit/xlat/func.txt
src/tests/unit/xlat/purify.txt
src/tests/xlat/expr.txt

index 27669983b4e4a733d857c01834b93750c68aad9f..4bc73b8d61ad2ed382b782226193e889d3e0d936 100644 (file)
@@ -63,7 +63,7 @@ As of the time of this release, FreeRADIUS:
   ** The server still doesn't always require (or print) the `::` prefix.  That will change.
   ** By implementing `::` for enums, the requirement to use `&` as a prefix for attribute names is not needed.
   ** This change may require an update to all of the configuration.  We will try to allow `&`, but that may not be possible.
-* Dynamic expansions have changed from `%{md5:foo}` to a more standard syntax of `%md5(foo)`.
+* Dynamic expansions have changed from `%{md5:foo}` to a more standard syntax of `%hash.md5(foo)`.
   ** The new syntax supports multiple comma-separated arguments such as `%function(a, b, c)`.
   ** Expansions such as `%{User-Name}` work in addition to expressions like `%{1+2}` too.
   ** Alternation `%{foo || bar}` supersedes `%{%{foo}:-%{bar}}` now.
index b83a62aaac847174aeae3b1e2f4dc988f7af9bab..dfa1634aa42fe380f9ad888c93f1a9a1bbebe696 100644 (file)
@@ -735,7 +735,7 @@ for further information.
 
 == Xlat expansions
 
-xref:reference:xlat/index.adoc[xlat] expansions have been changed from syntax like `%{md5:...}` to `%md5(...)`.
+xref:reference:xlat/index.adoc[xlat] expansions have been changed from syntax like `%{md5:...}` to `%hash.md5(...)`.
 
 === Removed expansions
 
index 29932ffa55404f982a27fbd09042251a3f42c8c1..04ca629c817e390628af071cf30dd81742685bcd 100644 (file)
@@ -432,7 +432,7 @@ cache {
        update {
                reply.Reply-Message := reply.Reply-Message
                reply.Reply-Message += "Cache last updated at %t"
-               reply.Class := "%randstr(ssssssssssssssssssssssssssssssss)"
+               reply.Class := "%str.rand(ssssssssssssssssssssssssssssssss)"
        }
 }
 ```
index 90acf6deead637dd0e8fd303adf48f63ef989d61..bfaca7ce750f667a4900efbd882704792d71fa31 100644 (file)
@@ -215,7 +215,7 @@ In the `request { ... }` subsection, the following config items may be listed:
                    may be specified with `body`. Will be expanded.
                    Values from expansion will not be escaped, this should be
       done using the appropriate `xlat` method e.g.
-      `%urlquote(<attr>)`
+      `%url.quote(<attr>)`
 | `auth`         | HTTP auth method to use, one of 'none', 'srp', 'basic',                     | yes
                    'digest', 'digest-ie', 'gss-negotiate', 'ntlm',
                    'ntlm-winbind', 'any', 'safe'. defaults to _'none'_.
index 96b2d99592712020c484c9697dd385b29863748e..b32135cafe8e4f256eef1c9a24be5edec6d75d77 100644 (file)
@@ -66,7 +66,7 @@ immediately.
 Set the random number to save.
 
 ```
-       session-state.challenge-string := "%randstr(n)"
+       session-state.challenge-string := "%str.rand(n)"
        reply.Reply-Message := "Please enter %{session-state.challenge-string}: "
 
 ```
index 8999458ee8e10d1819ab3695574ee0474359fa36..c35d6766f4f5077b344e07b79011eed34d49d4ef 100644 (file)
@@ -163,7 +163,7 @@ Keep a count of what we send.
 Split the string and split into pieces.
 
 ```
-               if ("%explode(control.user-session, '|')") {
+               if ("%str.split(control.user-session, '|')") {
 
                        foreach control.user-session {
 ```
index 13e60b6950c21a91ac546fdf083202a2e79cd228..1db5ca3c7b6c90fdf0ce47153670075395f34adb 100644 (file)
@@ -1276,7 +1276,7 @@ Service-Type = ::Authorize-Only.
 
 ```
 #      if (!reply.State) {
-#              reply.State := "0x%randstr(16h)"
+#              reply.State := "0x%str.rand(16h)"
 #      }
 
 ```
index 6ceb7b3bdcd60cafbc95c536e741b4da17baa460..039281843d2915e6574df46212577bf9a6790d4a 100644 (file)
@@ -567,7 +567,7 @@ values:
 
 - The encrypt expansions of the `rlm_cipher` module.
 - The `%3gpp_temporary_id_encrypt()` expansion.
-- The `%randstr()` expansion.
+- The `%str.rand()` expansion.
 
 NOTE: Add a `reply.Next-Pseudonym-Id` attribute in this section to
 avoid having the permanent Id of the SIM exposed during subsequent
index 8cc7401e66e63fc2cf688fa4755bc79cae9093ef..614027fbad88ff9a26d60c499582f28a6ff2c42e 100644 (file)
@@ -434,7 +434,7 @@ server settings as ldap_sync.
 ```
 
 ```
-#                      csn := %concat(%ldap("ldap:///%ldap.uri.safe(%{LDAP-Sync.Directory-Root-DN})?contextCSN?base"), ';')
+#                      csn := %str.concat(%ldap("ldap:///%ldap.uri.safe(%{LDAP-Sync.Directory-Root-DN})?contextCSN?base"), ';')
 #                      reply.LDAP-Sync.Cookie := "rid=000,csn=%{csn}"
 #              }
        }
index bccc06947ee95e2788684e8f977fbd58e608c7da..668282a88a7e1d29593562788a2538b2dd77ac21 100644 (file)
@@ -147,24 +147,24 @@ attribute, which each carry one octet of the IP address.
 
 .Example Creating multiple Attributes
 ----
-Tmp-Integer-0 := %explode("192.168.0.1", '.')
+Tmp-Integer-0 := %str.split("192.168.0.1", '.')
 ----
 
 If you need to cast an entire list to a value, then the value being
 cast should be surrounded by brackets.
 
-In the following example, the `%explode()` function will return a list
+In the following example, the `%str.split()` function will return a list
 of four values: `{"192", "168", "0", "1"}`.  Casting that to a string
 causes the values to be merged together, The resulting string is
 `"19216801"`.
 
 If you need to add text in between each list entry, see the
-`%concat()` function in the xref:xlat/builtin.adoc[built-in
+`%str.concat()` function in the xref:xlat/builtin.adoc[built-in
 expansions] list.
 
 .Example Creating multiple Attributes
 ----
-reply.Reply-Message := (string) (%explode("192.168.0.1", '.'))
+reply.Reply-Message := (string) (%str.split("192.168.0.1", '.'))
 ----
 
 === Other Data Types
index d3475336f9228cafbd536a7c1bc377528d0b6c85..249481eedff7e64a6941cbf9c243fe7ba47f9254 100644 (file)
@@ -1,4 +1,4 @@
-= %concat(<ref:[idx]>, <delim>)
+= %str.concat(<ref:[idx]>, <delim>)
 
 Used to join two or more attributes, separated by an optional delimiter.
 
@@ -6,7 +6,7 @@ This expansion is the inverse of xref:xlat/explode.adoc[explode].
 
 .Return: _string_
 
-In most cases, `%concat(...)` is only useful inside of a dynamically
+In most cases, `%str.concat(...)` is only useful inside of a dynamically
 expanded string.  If you need to concatenate strings together in a policy, just use `+`.
 
 .Example
@@ -20,8 +20,8 @@ control += {
 }
 
 reply += {
-    Reply-Message = "%concat(%{control.Tmp-String-0[*]}, ', ')"
-    Reply-Message = "%concat(%{control.Tmp-String-0[*]}, ',')"
+    Reply-Message = "%str.concat(%{control.Tmp-String-0[*]}, ', ')"
+    Reply-Message = "%str.concat(%{control.Tmp-String-0[*]}, ',')"
 }
 ----
 
index 34a7034aafc238022ffd467b3bcedb1eb4e74328..6233d237a3e00266ddb0e64f2a2833720865266e 100644 (file)
@@ -82,7 +82,7 @@ reply.Reply-Message := "The value of %{control.Tmp-String-0} in hex is %hex(%{co
 The value of 12345 in hex is 3132333435
 ```
 
-== %urlquote( ... )
+== %url.quote( ... )
 
 Quote URL special characters.
 
@@ -94,7 +94,7 @@ Quote URL special characters.
 ----
 control.Tmp-String-0 := "http://example.org/"
 reply += {
-       Reply-Message = "The urlquote of %{control.Tmp-String-0} is %urlquote(%{control.Tmp-String-0})"
+       Reply-Message = "The urlquote of %{control.Tmp-String-0} is %url.quote(%{control.Tmp-String-0})"
 }
 ----
 
@@ -104,7 +104,7 @@ reply += {
 The urlquote of http://example.org/ is http%3A%2F%2Fexample.org%2F
 ```
 
-== %urlunquote( ... )
+== %url.unquote( ... )
 
 Unquote URL special characters.
 
@@ -116,7 +116,7 @@ Unquote URL special characters.
 ----
 control.Tmp-String-0 := "http%%3A%%2F%%2Fexample.org%%2F" # Attention for the double %.
 reply += {
-       Reply-Message = "The urlunquote of %{control.Tmp-String-0} is %urlunquote(%{control.Tmp-String-0})"
+       Reply-Message = "The urlunquote of %{control.Tmp-String-0} is %url.unquote(%{control.Tmp-String-0})"
 }
 ----
 
index 675a3193e384cb0592e9e1461ceff38ce4721176..dad1ef652d4b172b3a9157ba3fd36a1fe35b1625 100644 (file)
@@ -5,13 +5,13 @@ The following functions perform lookups based on dictionary names and numbers.
 The functions are defined in the `dict` module.  It must be listed in
 the `mods-enabled/` directory in order for the expansions to work.
 
-== %concat(<ref:[idx]>, <delim>)
+== %str.concat(<ref:[idx]>, <delim>)
 
 Used to join two or more attributes, separated by an optional delimiter.
 
 .Return: _string_
 
-In most cases, `%concat(...)` is only useful inside of a dynamically
+In most cases, `%str.concat(...)` is only useful inside of a dynamically
 expanded string.  If you need to concatenate strings together in a policy, just use `+`.
 
 .Example
@@ -25,8 +25,8 @@ control += {
 }
 
 reply += {
-    Reply-Message = "%concat(%{control.Tmp-String-0[*]}, ', ')"
-    Reply-Message = "%concat(%{control.Tmp-String-0[*]}, ',')"
+    Reply-Message = "%str.concat(%{control.Tmp-String-0[*]}, ', ')"
+    Reply-Message = "%str.concat(%{control.Tmp-String-0[*]}, ',')"
 }
 ----
 
@@ -47,11 +47,11 @@ foo += { "a", "c", "c", "d" } # abcd
 foo += control.Tmp-String-0[*]
 ----
 
-== %explode(<ref>, <delim>)
+== %str.split(<ref>, <delim>)
 
 Split an string into multiple new strings based on a delimiter.
 
-This expansion is the opposite of `%concat( ... )`.
+This expansion is the opposite of `%str.concat( ... )`.
 
 .Return: _the number exploded list of strings_.
 
@@ -61,7 +61,7 @@ This expansion is the opposite of `%concat( ... )`.
 ----
 control.Tmp-String-0 := "bob.toba@domain.com"
 
-control.Tmp-String-1 := "%explode(control.Tmp-String-0, '@')"
+control.Tmp-String-1 := "%str.split(control.Tmp-String-0, '@')"
 
 reply.Reply-Message := "Welcome %{control.Tmp-String-1[0]}"
 ----
@@ -72,7 +72,7 @@ reply.Reply-Message := "Welcome %{control.Tmp-String-1[0]}"
 Welcome bob.toba
 ```
 
-== %lpad(<string>, <val>, <char>)
+== %str.lpad(<string>, <val>, <char>)
 
 Left-pad a string.
 
@@ -84,7 +84,7 @@ Left-pad a string.
 ----
 control.Tmp-String-0 := "123"
 
-reply.Reply-Message := "Maximum should be %lpad(%{control.Tmp-String-0}, 11, '0')"
+reply.Reply-Message := "Maximum should be %str.lpad(%{control.Tmp-String-0}, 11, '0')"
 ----
 
 .Output
@@ -93,7 +93,7 @@ reply.Reply-Message := "Maximum should be %lpad(%{control.Tmp-String-0}, 11, '0'
 Maximum should be 00000000123
 ```
 
-== %rpad(<string>, <val>, <char>)
+== %str.rpad(<string>, <val>, <char>)
 
 Right-pad a string.
 
@@ -105,7 +105,7 @@ Right-pad a string.
 ----
 control.Tmp-String-0 := "123"
 
-reply.Reply-Message := "Maximum should be %rpad(%{control.Tmp-String-0}, 11, '0')"
+reply.Reply-Message := "Maximum should be %str.rpad(%{control.Tmp-String-0}, 11, '0')"
 ----
 
 .Output
@@ -134,7 +134,7 @@ reply.Reply-Message := "Serialize output: %pairs(control.[*])"
 Serialize output: Tmp-String-0 = "\"This is a string\", Tmp-String-0 = \"This is another one\""
 ```
 
-== %randstr( ...)
+== %str.rand( ...)
 
 Get random string built from character classes.
 
@@ -144,7 +144,7 @@ Get random string built from character classes.
 
 [source,unlang]
 ----
-reply.Reply-Message := "The random string output is %randstr(aaaaaaaa}"
+reply.Reply-Message := "The random string output is %str.rand(aaaaaaaa}"
 ----
 
 .Output
@@ -153,7 +153,7 @@ reply.Reply-Message := "The random string output is %randstr(aaaaaaaa}"
 The random string output is 4Uq0gPyG
 ```
 
-== %tolower( ... )
+== %str.lower( ... )
 
 Dynamically expands the string and returns the lowercase version of
 it. This definition is only available in version 2.1.10 and later.
@@ -165,7 +165,7 @@ it. This definition is only available in version 2.1.10 and later.
 [source,unlang]
 ----
 control.Tmp-String-0 := "CAIPIRINHA"
-reply.Reply-Message := "tolower of %{control.Tmp-String-0} is %tolower(%{control.Tmp-String-0})"
+reply.Reply-Message := "tolower of %{control.Tmp-String-0} is %str.lower(%{control.Tmp-String-0})"
 ----
 
 .Output
@@ -174,7 +174,7 @@ reply.Reply-Message := "tolower of %{control.Tmp-String-0} is %tolower(%{control
 tolower of CAIPIRINHA is caipirinha
 ```
 
-== %toupper( ... )
+== %str.upper( ... )
 
 Dynamically expands the string and returns the uppercase version of
 it. This definition is only available in version 2.1.10 and later.
@@ -186,7 +186,7 @@ it. This definition is only available in version 2.1.10 and later.
 [source,unlang]
 ----
 control.Tmp-String-0 := "caipirinha"
-reply.Reply-Message := "toupper of %{control.Tmp-String-0} is " + %toupper(%{control.Tmp-String-0})
+reply.Reply-Message := "toupper of %{control.Tmp-String-0} is " + %str.upper(%{control.Tmp-String-0})
 ----
 
 .Output
index 09217687d5d506834bb0c8601498dd4bc2096fd7..bf174aef5510d8f01f1f9d90305359ba20d1313c 100644 (file)
@@ -1,4 +1,4 @@
-= %explode(<ref>, <delim>)
+= %str.split(<ref>, <delim>)
 
 Split an string into multiple new strings based on a delimiter.
 
@@ -12,7 +12,7 @@ This expansion is the inverse of xref:xlat/concat.adoc[concat].
 ----
 control.Tmp-String-0 := "bob.toba@domain.com"
 
-control.Tmp-String-1 := "%explode(control.Tmp-String-0, '@')"
+control.Tmp-String-1 := "%str.split(control.Tmp-String-0, '@')"
 
 reply.Reply-Message := "Welcome %{control.Tmp-String-1[0]}"
 ----
index 98d61e44f1ecc39bd589d1eaa99d51879b918df4..6cf8342eab0a756a5e3323aad135fe1ba1438e0c 100644 (file)
@@ -27,7 +27,7 @@ call syntax is for that function.
 .Example
 [source,unlang]
 ----
-if (User-Name == %md5(NAS-Identifier)) {
+if (User-Name == %hash.md5(NAS-Identifier)) {
     reject
 }
 ----
index 6a0511768e08f503954a3c22da779cef1bd57b7a..5492ffb60209943d17574f1f7767f4ac3814cf47 100644 (file)
@@ -6,7 +6,7 @@ Note that the server supports insecure hashing methods such as MD5 and
 SHA1.  These functions are here for historical compatibility and
 completeness.
 
-== %hmacmd5(<shared_key>, <string>)
+== %hmac.md5(<shared_key>, <string>)
 
 Generate `HMAC-MD5` of string.
 
@@ -18,7 +18,7 @@ Generate `HMAC-MD5` of string.
 ----
 control.Tmp-String-0 := "mykey"
 control.Tmp-String-1 := "Caipirinha"
-reply.control.Tmp-Octets-0 := "%hmacmd5(%{control.Tmp-String-0} %{control.Tmp-String-1})"
+reply.control.Tmp-Octets-0 := "%hmac.md5(%{control.Tmp-String-0} %{control.Tmp-String-1})"
 
 reply += {
     Reply-Message = "The HMAC-MD5 of %{control.Tmp-String-1} in octets is %{control.Tmp-Octets-0}"
@@ -33,7 +33,7 @@ The HMAC-MD5 of Caipirinha in octets is \317}\264@K\216\371\035\304\367\202,c\37
 The HMAC-MD5 of Caipirinha in hex is 636f6e74726f6c3a546d702d4f63746574732d30
 ```
 
-== %hmacsha1(<shared_key>, <string>)
+== %hmac.sha1(<shared_key>, <string>)
 
 Generate `HMAC-SHA1` of string.
 
@@ -45,7 +45,7 @@ Generate `HMAC-SHA1` of string.
 ----
 control.Tmp-String-0 := "mykey"
 control.Tmp-String-1 := "Caipirinha"
-control.Tmp-Octets-0 := "%hmacsha1(%{control.Tmp-String-0}, %{control.Tmp-String-1})"
+control.Tmp-Octets-0 := "%hmac.sha1(%{control.Tmp-String-0}, %{control.Tmp-String-1})"
 
 reply += {
     Reply-Message = "The HMAC-SHA1 of %{control.Tmp-String-1} in octets is %{control.Tmp-Octets-0}"
@@ -60,7 +60,7 @@ The HMAC-SHA1 of Caipirinha in octets is \311\007\212\234j\355\207\035\225\256\3
 The HMAC-SHA1 of Caipirinha in hex is 636f6e74726f6c3a546d702d4f63746574732d30
 ```
 
-== %md5( ... )
+== %hash.md5( ... )
 
 Dynamically expands the string and performs an MD5 hash on it. The
 result is binary data.
@@ -73,8 +73,8 @@ result is binary data.
 ----
 control.Tmp-String-0 := "Caipirinha"
 reply += {
-    Reply-Message = "md5 of %{control.Tmp-String-0} is octal=%md5(%{control.Tmp-String-0})"
-    Reply-Message = "md5 of %{control.Tmp-String-0} is hex=%hex(%md5(%{control.Tmp-String-0}))"
+    Reply-Message = "md5 of %{control.Tmp-String-0} is octal=%hash.md5(%{control.Tmp-String-0})"
+    Reply-Message = "md5 of %{control.Tmp-String-0} is hex=%hex(%hash.md5(%{control.Tmp-String-0}))"
 }
 ----
 
@@ -90,8 +90,8 @@ md5 of Caipirinha is hex=14840b6d647c7c98a3e732f833d86ea9
 The following hashes are supported for all versions of OpenSSL.
 
 * `%md2( ... }`
-* `%md4( ... }`
-* `%md5( ... }`
+* `%hash.md4( ... }`
+* `%hash.md5( ... }`
 * `%sha1( ... }`
 * `%sha224( ... }`
 * `%sha256( ... }`
@@ -102,16 +102,16 @@ The following hashes are supported for when OpenSSL 1.1.1 or greater
 is installed.  This version adds support for the `sha3` and `blake`
 families of digest functions.
 
-* `%blake2s_256( ... )`
-* `%blake2b_512( ... )`
-* `%sha2_224( ... )`
-* `%sha2_256( ... )`
-* `%sha2_384( ... )`
-* `%sha2_512( ... )`
-* `%sha3_224( ... )`
-* `%sha3_256( ... )`
-* `%sha3_384( ... )`
-* `%sha3_512( ... )`
+* `%hash.blake2s_256( ... )`
+* `%hash.blake2b_512( ... )`
+* `%hash.sha2_224( ... )`
+* `%hash.sha2_256( ... )`
+* `%hash.sha2_384( ... )`
+* `%hash.sha2_512( ... )`
+* `%hash.sha3_224( ... )`
+* `%hash.sha3_256( ... )`
+* `%hash.sha3_384( ... )`
+* `%hash.sha3_512( ... )`
 
 .Return: _octal_
 
@@ -121,8 +121,8 @@ families of digest functions.
 ----
 control.Tmp-String-0 := "Caipirinha"
 reply += {
-    Reply-Message = "The md5 of %{control.Tmp-String-0} in octal is %md5(%{control.Tmp-String-0}}"
-    Reply-Message = "The md5 of %{control.Tmp-String-0} in hex is %hex(%md5(%{control.Tmp-String-0}}}"
+    Reply-Message = "The md5 of %{control.Tmp-String-0} in octal is %hash.md5(%{control.Tmp-String-0}}"
+    Reply-Message = "The md5 of %{control.Tmp-String-0} in hex is %hex(%hash.md5(%{control.Tmp-String-0}}}"
 }
 ----
 
index e4d194603ba1303d244875089349d726314525cd..32c1f77e7dd113f417352cb86f640334f63137b2 100644 (file)
@@ -1,4 +1,4 @@
-= %lpad(<string>, <val>, <char>)
+= %str.lpad(<string>, <val>, <char>)
 
 Left-pad a string.
 
@@ -10,7 +10,7 @@ Left-pad a string.
 ----
 control.Tmp-String-0 := "123"
 
-reply.Reply-Message := "Maximum should be %lpad(%{control.Tmp-String-0}, 11, '0')"
+reply.Reply-Message := "Maximum should be %str.lpad(%{control.Tmp-String-0}, 11, '0')"
 ----
 
 .Output
index f3c784b1f1dee9876b570cd7a59729cc4480e630..fe8d7efebea99e6ec4a6b2bf7227f436fb02dbeb 100644 (file)
@@ -1,4 +1,4 @@
-= %randstr( <format> )
+= %str.rand( <format> )
 
 Get random string built from input character classes.
 
@@ -32,7 +32,7 @@ There is no `h` for "hex".  Instead, use `b` to create binary data, followed by
 
 [source,unlang]
 ----
-reply.Reply-Message := "The random string output is %randstr(8a)"
+reply.Reply-Message := "The random string output is %str.rand(8a)"
 ----
 
 .Output
index 8e20957100e18c58acb9c39433abf694124b0f05..757308d07a7ae875353a2576d9dd9508beecb731 100644 (file)
@@ -1,4 +1,4 @@
-= %rpad(<string>, <val>, <char>)
+= %str.rpad(<string>, <val>, <char>)
 
 Right-pad a string.
 
@@ -10,7 +10,7 @@ Right-pad a string.
 ----
 control.Tmp-String-0 := "123"
 
-reply.Reply-Message := "Maximum should be %rpad(%{control.Tmp-String-0}, 11, '0')"
+reply.Reply-Message := "Maximum should be %str.rpad(%{control.Tmp-String-0}, 11, '0')"
 ----
 
 .Output
index 0991fc066f93574d5c4a1d3748a5fdb00d9aff48..df503742ff0554c314683174bcff69c2f1509496 100644 (file)
@@ -1,4 +1,4 @@
-= %tolower( ... )
+= %str.lower( ... )
 
 Dynamically expands the string and returns the lowercase version of
 it.
@@ -12,7 +12,7 @@ The lowercase operation is done using the current locale.
 [source,unlang]
 ----
 control.Tmp-String-0 := "CAIPIRINHA"
-reply.Reply-Message := "tolower of %{control.Tmp-String-0} is %tolower(%{control.Tmp-String-0})"
+reply.Reply-Message := "tolower of %{control.Tmp-String-0} is %str.lower(%{control.Tmp-String-0})"
 ----
 
 .Output
index 7a88d073f4881b21e6eb07924e2fdd405986feb5..dd0288bf4acad52e7689b3dab02e54df18279577 100644 (file)
@@ -1,4 +1,4 @@
-= %toupper( ... )
+= %str.upper( ... )
 
 Dynamically expands the string and returns the uppercase version of
 it.
@@ -12,7 +12,7 @@ The uppercasecase operation is done using the current locale.
 [source,unlang]
 ----
 control.Tmp-String-0 := "caipirinha"
-reply.Reply-Message := "toupper of %{control.Tmp-String-0} is " + %toupper(%{control.Tmp-String-0})
+reply.Reply-Message := "toupper of %{control.Tmp-String-0} is " + %str.upper(%{control.Tmp-String-0})
 ----
 
 .Output
index 91c4a0b9be73710be2c903005f1d207d4f20a5a0..11d6450dab1f7208486af20cdd900643215d32aa 100644 (file)
@@ -269,7 +269,7 @@ cache {
                reply.Reply-Message += "Cache last updated at %t"
 
                #  Add your own value for `Class`.
-               reply.Class := "%randstr(ssssssssssssssssssssssssssssssss)"
+               reply.Class := "%str.rand(ssssssssssssssssssssssssssssssss)"
        }
 
        #
index 1c2762a115a410ba2be7f44eaa6c3053ac5dc7db..8b2bb631bdc4a59df1d35f03406a65c338ab89cc 100644 (file)
@@ -237,7 +237,7 @@ rest {
        #                     may be specified with `body`. Will be expanded.
        #                     Values from expansion will not be escaped, this should be
        #                     done using the appropriate `xlat` method e.g.
-       #                     `%urlquote(<attr>)`
+       #                     `%url.quote(<attr>)`
        #  | `auth`         | HTTP auth method to use, one of 'none', 'srp', 'basic',                   | yes
        #                     'digest', 'digest-ie', 'gss-negotiate', 'ntlm',
        #                     'ntlm-winbind', 'any', 'safe'. defaults to _'none'_.
index a918aff9976ef9316096dc63747df2a17bf1f4ed..a206305cf7de0701cc08c502d1ef40c2c12328b7 100644 (file)
@@ -27,7 +27,7 @@ class_value_prefix = 'ai:'
 #      We fix this issue by converting the MD5 inputs into printable
 #      string form.
 #
-#      Similarly, the output of `%md5(..)` is binary safe, and is
+#      Similarly, the output of `%hash.md5(..)` is binary safe, and is
 #      therefore a binary blob.  We therefore convert the output
 #      of it to a printable string via `%hex(...)`
 #
@@ -58,7 +58,7 @@ acct_unique {
        #  wireless environment).
        #
        if (Class =~ /${policy.class_value_prefix}([0-9a-f]{32})/i) {
-               request.Acct-Unique-Session-Id := %hex(%md5("%{1}%{Acct-Session-ID}"))
+               request.Acct-Unique-Session-Id := %hex(%hash.md5("%{1}%{Acct-Session-ID}"))
        }
 
        #
@@ -68,7 +68,7 @@ acct_unique {
        #  is not included
        #
        else {
-               request.Acct-Unique-Session-Id := %hex(%md5("%{User-Name},%{Acct-Multi-Session-ID},%{Acct-Session-ID},%{NAS-IPv6-Address || NAS-IP-Address},%{NAS-Identifier},%{NAS-Port-ID},%{NAS-Port}"))
+               request.Acct-Unique-Session-Id := %hex(%hash.md5("%{User-Name},%{Acct-Multi-Session-ID},%{Acct-Session-ID},%{NAS-IPv6-Address || NAS-IP-Address},%{NAS-Identifier},%{NAS-Port-ID},%{NAS-Port}"))
        }
 }
 
@@ -76,7 +76,7 @@ acct_unique {
 #      Insert a (hopefully unique) value into class
 #
 insert_acct_class {
-       reply.Class = '${policy.class_value_prefix}' + %hex(%md5("%t%I%{Net.Src.Port}%{Net.Src.IP}%{NAS-IP-Address}%{Calling-Station-ID}%{User-Name}"))
+       reply.Class = '${policy.class_value_prefix}' + %hex(%hash.md5("%t%I%{Net.Src.Port}%{Net.Src.IP}%{NAS-IP-Address}%{Calling-Station-ID}%{User-Name}"))
 }
 
 #
index ba3f548c6d6fb6f68d416f8f9a6ad371a98b82bb..c7f00c15962f035689aa8c1e54d81d417e41fae6 100644 (file)
@@ -52,7 +52,7 @@ mac-addr-regexp = '([0-9a-f]{2})[^0-9a-f]?([0-9a-f]{2})[^0-9a-f]?([0-9a-f]{2})[^
 #
 rewrite_called_station_id {
        if (Called-Station-Id && (Called-Station-Id =~ /^${policy.mac-addr-regexp}([^0-9a-f](.+))?$/i)) {
-               request.Called-Station-Id := %toupper("%{1}-%{2}-%{3}-%{4}-%{5}-%{6}")
+               request.Called-Station-Id := %str.upper("%{1}-%{2}-%{3}-%{4}-%{5}-%{6}")
 
                # SSID component?
                if (%{8}) {
@@ -74,7 +74,7 @@ rewrite_called_station_id {
 #
 rewrite_calling_station_id {
        if (Calling-Station-Id && (Calling-Station-Id =~ /^${policy.mac-addr-regexp}$/i)) {
-               request.Calling-Station-Id := %toupper("%{1}-%{2}-%{3}-%{4}-%{5}-%{6}")
+               request.Calling-Station-Id := %str.upper("%{1}-%{2}-%{3}-%{4}-%{5}-%{6}")
 
                updated
        }
index 32d2f4452231c57676dd3a34d831d0834000fda3..68e52ca8ca6eaedb54341d63323334f8c40ef136 100644 (file)
@@ -54,7 +54,7 @@ cui.authorize {
 cui.post-auth {
        if (!control.Proxy-To-Realm && Chargeable-User-Identity && !reply.Chargeable-User-Identity &&
            (Operator-Name || ('${policy.cui_require_operator_name}' != 'yes')) ) {
-               reply.Chargeable-User-Identity = %sha1("${policy.cui_hash_key}%tolower(%{User-Name}%{Operator-Name || ''})")
+               reply.Chargeable-User-Identity = %sha1("${policy.cui_hash_key}%str.lower(%{User-Name}%{Operator-Name || ''})")
        }
 
        #
@@ -77,7 +77,7 @@ cui.post-auth {
 cui-inner.post-auth {
        if (outer.request.Chargeable-User-Identity && \
            (outer.request.Operator-Name || ('${policy.cui_require_operator_name}' != 'yes'))) {
-               reply.Chargeable-User-Identity := %sha1("${policy.cui_hash_key}%tolower(%{User-Name}%{outer.request.Operator-Name || ''})")
+               reply.Chargeable-User-Identity := %sha1("${policy.cui_hash_key}%str.lower(%{User-Name}%{outer.request.Operator-Name || ''})")
        }
 }
 
index 3f12f2a4433aa651c2b05a2d579002674bf97606..d904f9e11bd80195006955a37e2690801f670d4e 100644 (file)
@@ -37,7 +37,7 @@ filter_username {
                #
                #  reject mixed case e.g. "UseRNaMe"
                #
-               #if (User-Name != %tolower(User-Name)) {
+               #if (User-Name != %str.lower(User-Name)) {
                #       reject
                #}
 
@@ -126,7 +126,7 @@ filter_password {
                #  Because "\000" yields "zero length delimiter is not allowed"
                #
                delim = 0x00
-               tmp.User-Password := %explode(%{User-Password}, "%{delim}")
+               tmp.User-Password := %str.split(%{User-Password}, "%{delim}")
 
                User-Password := tmp.User-Password[0]
        }
index 02bc5348c80f8b5896d3436216771d3859e86a1b..15ca6191b458a25bd804dd8534c7dd86769cc09f 100644 (file)
@@ -58,7 +58,7 @@ authenticate step1 {
        #
        #  Set the random number to save.
        #
-       session-state.challenge-string := "%randstr(n)"
+       session-state.challenge-string := "%str.rand(n)"
        reply.Reply-Message := "Please enter %{session-state.challenge-string}: "
 
        #
index 3fa36dd24b3ae542743c62735d3f3d08caa2ba3a..440cc8b68aa7ac05f35783e8ac3e54acc21a6c7d 100644 (file)
@@ -147,7 +147,7 @@ server coa {
                #
                #  Split the string and split into pieces.
                #
-               if ("%explode(control.user-session, '|')") {
+               if ("%str.split(control.user-session, '|')") {
 
                        foreach control.user-session {
                                #
index efd14d522deb3590cc1c2f5d4f5417c00c769121..e4508cfeb5a44fcf282e937c82759a8f9e542ecf 100644 (file)
@@ -1132,7 +1132,7 @@ send Access-Accept {
        #  Service-Type = ::Authorize-Only.
        #
 #      if (!reply.State) {
-#              reply.State := "0x%randstr(16h)"
+#              reply.State := "0x%str.rand(16h)"
 #      }
 
        #
index cf5361c1d4c72c23b66ed4bea929a6cf109d9b2c..95d6ef848d08c6d117b53f72ce972172f96174a3 100644 (file)
@@ -530,7 +530,7 @@ server eap-aka-sim {
        #
        #  - The encrypt expansions of the `rlm_cipher` module.
        #  - The `%3gpp_temporary_id_encrypt()` expansion.
-       #  - The `%randstr()` expansion.
+       #  - The `%str.rand()` expansion.
        #
        #  NOTE: Add a `reply.Next-Pseudonym-Id` attribute in this section to
        #  avoid having the permanent Id of the SIM exposed during subsequent
index b92a43fdb0241ed26b0d82c68cf2a349e1c8d2c5..9df4499f45522a80fb285c485f0ab4eddba17603 100644 (file)
@@ -383,7 +383,7 @@ server ldap_sync {
 #              if (!reply.LDAP-Sync.Cookie) {
 #                      string csn
 #
-#                      csn := %concat(%ldap("ldap:///%ldap.uri.safe(%{LDAP-Sync.Directory-Root-DN})?contextCSN?base"), ';')
+#                      csn := %str.concat(%ldap("ldap:///%ldap.uri.safe(%{LDAP-Sync.Directory-Root-DN})?contextCSN?base"), ';')
 #                      reply.LDAP-Sync.Cookie := "rid=000,csn=%{csn}"
 #              }
        }
index 8ef157297f230491876f0d8d29b2cd9358eb8128..b168dd0006193e8f62fc52b62ff456964f1e1394 100644 (file)
@@ -4,7 +4,7 @@
 #  Test the acct_unique policy
 #
 #
-Acct-Unique-Session-Id := %hex(%md5("%{User-Name},%{Acct-Multi-Session-ID},%{Acct-Session-ID},%{NAS-IPv6-Address || NAS-IP-Address},%{NAS-Identifier},%{NAS-Port-ID},%{NAS-Port}"))
+Acct-Unique-Session-Id := %hex(%hash.md5("%{User-Name},%{Acct-Multi-Session-ID},%{Acct-Session-ID},%{NAS-IPv6-Address || NAS-IP-Address},%{NAS-Identifier},%{NAS-Port-ID},%{NAS-Port}"))
 
 if Acct-Unique-Session-Id != "159dccf021583d7413b0114a090529ca" {
        test_fail
index a2410bb8553b11fde22de8adf959f1c9099e65d8..7a70206e8d51536dcbad04d4c9b59a994c0c88e8 100644 (file)
@@ -1 +1 @@
-request.Acct-Unique-Session-Id := %hex(%md5("%{User-Name},%{Acct-Multi-Session-ID},%{Acct-Session-ID},%{%{NAS-IPv6-Address}:-%{NAS-IP-Address}},%{NAS-Identifier},%{NAS-Port-ID},%{NAS-Port}")) # ERROR
+request.Acct-Unique-Session-Id := %hex(%hash.md5("%{User-Name},%{Acct-Multi-Session-ID},%{Acct-Session-ID},%{%{NAS-IPv6-Address}:-%{NAS-IP-Address}},%{NAS-Identifier},%{NAS-Port-ID},%{NAS-Port}")) # ERROR
index 11c4db3cfc3498315be3950431384fb56805d4c9..d83510fd8ac18b256b9f2d3ab4126fb05ddc6f79 100644 (file)
@@ -46,35 +46,35 @@ control -= NAS-Port[*]
 ok     # separate updates
 
 
-result_string := %concat(%{control.[*]}, ', ')
+result_string := %str.concat(%{control.[*]}, ', ')
 
 "%{result_string}"
 if (!(result_string == "bob, hello, ab c, de fg, 123")) {
        test_fail
 }
 
-result_string := %concat(%{control.Calling-Station-Id[*]}, ', ')
+result_string := %str.concat(%{control.Calling-Station-Id[*]}, ', ')
 
 if (!(result_string == "ab c, de fg")) {
        test_fail
 }
 
 # Empty separator
-result_string := %concat(%{control.Calling-Station-Id[*]})
+result_string := %str.concat(%{control.Calling-Station-Id[*]})
 
 if (!(result_string == "ab cde fg")) {
        test_fail
 }
 
 # Single character separator
-result_string := %concat(%{control.Calling-Station-Id[*]}, ',')
+result_string := %str.concat(%{control.Calling-Station-Id[*]}, ',')
 
 if (!(result_string == "ab c,de fg")) {
        test_fail
 }
 
 # Multi character separator not delimited
-result_string := %concat(%{control.Calling-Station-Id[*]}, '|-')
+result_string := %str.concat(%{control.Calling-Station-Id[*]}, '|-')
 
 if !(result_string == "ab c|-de fg") {
        test_fail
index d38ea9efbc4f32edcbe22c516a502cac0d2edc43..e16f2cc53c21b1530250d414502ba64f3e15391c 100644 (file)
@@ -7,7 +7,7 @@ baz = "a,b,c,d,e"
 #
 #  Append, don't create multiple versions
 #
-bar += %explode(baz, ',')
+bar += %str.split(baz, ',')
 
 if !(bar == "abcde") {
        test_fail
@@ -19,7 +19,7 @@ if !(bar == "abcde") {
 #  We cannot have multiple copies of local variables.  There's no real
 #  reason why, but for now it's safer to be limited.
 #
-foo := %explode(baz, ',')
+foo := %str.split(baz, ',')
 if !(foo[#] == 1) {
        test_fail
 }
index 772acbb270e089054ceeb48ce76fb98c35334d57..0cd08610f2e4cae2097ecc80d24577249850bd1d 100644 (file)
@@ -1,5 +1,5 @@
 #
 #  We only care if this crashes or not.
 #
-Filter-Id := "%{1 + 1} %tolower('1')"
+Filter-Id := "%{1 + 1} %str.lower('1')"
 success
index 2a1f66000c02e83156a78bc529b5b21951f58d56..48745dc28a92b7bb2ff2c2b7a7452050047b9989 100644 (file)
@@ -11,7 +11,7 @@ if %length(Reply-Message) != 9 {
 #
 #  This assignment grabs the first element of the list, and tosses the remaining ones.
 #
-Reply-Message := %explode(Reply-Message, 0x00)
+Reply-Message := %str.split(Reply-Message, 0x00)
 
 if Reply-Message != "bob" {
        test_fail
index 9cde9618c148be45914d81e07f6bcf9ac031d1db..9bc4b9ff0a0633ccbb62507c6641a2056a4dd09a 100644 (file)
@@ -1,3 +1,3 @@
-foreach thing ("%tolower('foo')") {    # ERROR
+foreach thing ("%str.lower('foo')") {  # ERROR
        reply.Called-Station-Id += thing
 }
index 11e3147337a2ff4ebfa762613985dee70f5c9c89..c81d010234ae641f322f2e4651a3b9044a1048c5 100644 (file)
@@ -7,7 +7,7 @@ string result
 input = "a b c d e f"
 result = ""
 
-foreach string thing (%explode(input, ' ')) {
+foreach string thing (%str.split(input, ' ')) {
        result += thing
        result += ','
 }
index 733fabf4c060174020f05085236a9e4895f3a191..807da7d6ecc00da7ceab55e70022548604562534 100644 (file)
@@ -7,7 +7,7 @@ string result
 input = "a b c d e f"
 result = ""
 
-foreach uint32 key,string thing (%explode(input, ' ')) {
+foreach uint32 key,string thing (%str.split(input, ' ')) {
        result += thing
        result += ':'
        result += (string) key
index 49e420317bfc4e4bafa744d3348c5392e0efade6..a9fa7e708c71bf29a33af59856f0a0eb87025b2b 100644 (file)
@@ -1,14 +1,14 @@
 #
 #  PRE: if
 #
-if !(%md5('foo') == 0xacbd18db4cc2f85cedef654fccc4a4d8) {
+if !(%hash.md5('foo') == 0xacbd18db4cc2f85cedef654fccc4a4d8) {
        test_fail
 }
 
 group {
        octets hash
 
-       hash = %md5('foo')
+       hash = %hash.md5('foo')
        if !(hash == 0xacbd18db4cc2f85cedef654fccc4a4d8) {
                test_fail
        }
index 6b8288b0237dda3ba9e9c2b11f62ffed7251d21a..911b365263a9a8e36321e2b469f3359c7f46bcb2 100644 (file)
@@ -30,13 +30,13 @@ debug_request
 #
 #  @todo - fix this...
 #
-result_string := %concat(%join(%{control.[*]}, request.Framed-IP-Address), '. ')
+result_string := %str.concat(%join(%{control.[*]}, request.Framed-IP-Address), '. ')
 
 if (!(result_string == "bob. hello. ab c. de fg. 123. 192.168.1.254")) {
        test_fail
 }
 
-result_string := %concat(%join(control.Filter-Id[*], control.NAS-Port), ',')
+result_string := %str.concat(%join(control.Filter-Id[*], control.NAS-Port), ',')
 if (!(result_string == "ab c,de fg,123")) {
        test_fail
 }
index f51251c6e9923254359405f6ce7027eaeac37432..06583eb6b9dfe5c746d8955a7713d2314bdfc757 100644 (file)
@@ -7,6 +7,6 @@
 #  value of the field, but does allow us to test that
 #  arg3 can be an xlat
 #
-map csv "%tolower(%{User-Name})" {
+map csv "%str.lower(%{User-Name})" {
        reply.Result-Status := 'field3'
 }
index 809d793f868575a66220776dccb1291a08913d35..4d2d93421db4653117808c86145219cf23c448a9 100644 (file)
@@ -2,6 +2,6 @@
 #  PRE: map
 #
 
-map csv "%tolower(%{User-Name})" {
+map csv "%str.lower(%{User-Name})" {
        reply.Result-Status := 'field3'
 }
index 61ec0f170acc7dc17f31867632921798e2939110..8713ce0c95c9ed54c16e3690c54964f671e097bf 100644 (file)
@@ -13,12 +13,12 @@ test_octets := 0x000504030201
 #  Put "This is a string" into a file and call "md4sum" on it.
 #  You should get this string.
 #
-result_octets := %md4("This is a string\n")
+result_octets := %hash.md4("This is a string\n")
 if (!(result_octets == 0x1f60d5cd85e17bfbdda7c923822f060c)) {
        test_fail
 }
 
-result_octets := %md4("%{test_string}")
+result_octets := %hash.md4("%{test_string}")
 if (!(result_octets == 0x1f60d5cd85e17bfbdda7c923822f060c)) {
        test_fail
 }
@@ -26,7 +26,7 @@ if (!(result_octets == 0x1f60d5cd85e17bfbdda7c923822f060c)) {
 #
 #  MD4 should also be able to cope with references to octet attributes
 #
-result_octets := %md4("%{test_octets}")
+result_octets := %hash.md4("%{test_octets}")
 if (!(result_octets == 0xac3ed17b3cf19ec38352ec534a932fc6)) {
        test_fail
 }
@@ -34,7 +34,7 @@ if (!(result_octets == 0xac3ed17b3cf19ec38352ec534a932fc6)) {
 #
 #  MD4 of null string is d41d8cd98f00b204e9800998ecf8427e
 #
-result_octets := %md4("%{dummy_string}")
+result_octets := %hash.md4("%{dummy_string}")
 if (!(result_octets == 0x31d6cfe0d16ae931b73c59d7e0c089c0)) {
        test_fail
 }
index 92117c5e81f34e5a239fa8fb195299ffb43dc3e5..ebbb16c0feb8a0ada81ebbbedf52c4cfcb55f01c 100644 (file)
@@ -17,12 +17,12 @@ test_hmac_data := "Jefe"
 #  Put "This is a string" into a file and call "md5sum" on it.
 #  You should get this string.
 #
-result_octets := %md5("This is a string\n")
+result_octets := %hash.md5("This is a string\n")
 if (!(result_octets == 0x9ac4dbbc3c0ad2429e61d0df5dc28add)) {
        test_fail
 }
 
-result_octets := %md5("%{test_string}")
+result_octets := %hash.md5("%{test_string}")
 if (!(result_octets == 0x9ac4dbbc3c0ad2429e61d0df5dc28add)) {
        test_fail
 }
@@ -30,7 +30,7 @@ if (!(result_octets == 0x9ac4dbbc3c0ad2429e61d0df5dc28add)) {
 #
 #  MD5 should also be able to cope with references to octet attributes
 #
-result_octets := %md5("%{test_octets}")
+result_octets := %hash.md5("%{test_octets}")
 if (!(result_octets == 0xc1e7fa505b2fc1fd0da6cac3db6f6f44)) {
        test_fail
 }
@@ -38,7 +38,7 @@ if (!(result_octets == 0xc1e7fa505b2fc1fd0da6cac3db6f6f44)) {
 #
 #  MD5 of null string is d41d8cd98f00b204e9800998ecf8427e
 #
-result_octets := %md5("%{dummy_string}")
+result_octets := %hash.md5("%{dummy_string}")
 if (!(result_octets == 0xd41d8cd98f00b204e9800998ecf8427e)) {
        test_fail
 }
@@ -46,7 +46,7 @@ if (!(result_octets == 0xd41d8cd98f00b204e9800998ecf8427e)) {
 #
 #  MD5 HMAC with attribute references
 #
-result_octets := %hmacmd5("%{test_hmac_key}", "%{test_hmac_data}")
+result_octets := %hmac.md5("%{test_hmac_key}", "%{test_hmac_data}")
 if (!(result_octets == 0x750c783e6ab0b503eaa86e310a5db738)) {
        test_fail
 }
@@ -55,7 +55,7 @@ if (!(result_octets == 0x750c783e6ab0b503eaa86e310a5db738)) {
 #  MD5 HMAC with empty key and data
 #
 dummy_string := ''
-result_octets := %hmacmd5("%{dummy_string}", "%{dummy_string}")
+result_octets := %hmac.md5("%{dummy_string}", "%{dummy_string}")
 if (!(result_octets == 0x74e6f7298a9c2d168935f58c001bad88)) {
        test_fail
 }
index 50ce95079878b2f6d1ae91d90e4ce79d3ee9e995..a46b25cc791af55ee93dd9e6a8871e1cd8ee3e6a 100644 (file)
@@ -9,7 +9,7 @@ test_string := "hello"
 #
 #  MD5 HMAC with missing key should fail
 #
-result_octets := %hmacmd5(%{test_string}, ) # ERROR
+result_octets := %hmac.md5(%{test_string}, ) # ERROR
 if result_octets {
        test_fail
 }
index 073c8961af0775b570f5f08df99b6f9323a5a260..658ea67f0e67b9f135dcca94b4795d690b045de6 100644 (file)
@@ -8,38 +8,38 @@ test_string = "test"
 #
 #      rpad tests
 #
-if (!(%rpad(%{test_string}, 7) == "test   ")) {
+if (!(%str.rpad(%{test_string}, 7) == "test   ")) {
        test_fail
 }
 
-if (!(%rpad(%{test_string}, 2) == "test")) {
+if (!(%str.rpad(%{test_string}, 2) == "test")) {
        test_fail
 }
 
-if (!(%rpad(%{test_string}, 7, 'x') == "testxxx")) {
+if (!(%str.rpad(%{test_string}, 7, 'x') == "testxxx")) {
        test_fail
 }
 
-if (!(%rpad(%{test_string}, 7, 'xy') == "testxyx")) {
+if (!(%str.rpad(%{test_string}, 7, 'xy') == "testxyx")) {
        test_fail
 }
 
 #
 #      lpad tests
 #
-if (!(%lpad(%{test_string}, 7) == "   test")) {
+if (!(%str.lpad(%{test_string}, 7) == "   test")) {
        test_fail
 }
 
-if (!(%lpad(%{test_string}, 2) == "test")) {
+if (!(%str.lpad(%{test_string}, 2) == "test")) {
        test_fail
 }
 
-if (!(%lpad(%{test_string}, 7, 'x') == "xxxtest")) {
+if (!(%str.lpad(%{test_string}, 7, 'x') == "xxxtest")) {
        test_fail
 }
 
-if (!(%lpad(%{test_string}, 7, 'xy') == "xyxtest")) {
+if (!(%str.lpad(%{test_string}, 7, 'xy') == "xyxtest")) {
        test_fail
 }
 
index 18993fb505eb07f2a66ced66dca51e80663d6303..e2527b771a380ae90767ef1272f2c0dc0efa8ded 100644 (file)
@@ -27,7 +27,7 @@ Tmp-Group-0 += {
 #
 #pairs := %cast('string', %{Tmp-Group-0.[*]})
 
-result_string := "%concat(%pairs('Tmp-Group-0.[*]'), ', ')"
+result_string := "%str.concat(%pairs('Tmp-Group-0.[*]'), ', ')"
 if !(result_string == 'Filter-Id = "This is a string", Filter-Id = "This is another one", Class = 0x000504030201, NAS-Port = 7331') {
        test_fail
 }
@@ -37,7 +37,7 @@ if !(result_string == 'Filter-Id = "This is a string"') {
        test_fail
 }
 
-result_string := "%concat(%pairs('Tmp-Group-0.Filter-Id[*]'), ', ')"
+result_string := "%str.concat(%pairs('Tmp-Group-0.Filter-Id[*]'), ', ')"
 if !(result_string == 'Filter-Id = "This is a string", Filter-Id = "This is another one"') {
        test_fail
 }
@@ -45,7 +45,7 @@ if !(result_string == 'Filter-Id = "This is a string", Filter-Id = "This is anot
 #
 #  Must be nested
 #
-result_string := "%concat(%pairs('control.[*]'), ', ')"
+result_string := "%str.concat(%pairs('control.[*]'), ', ')"
 if !(result_string == 'Password = { Cleartext = "hello" }') {
        test_fail
 }
index 38330a2233592b073f43b52ef56fec353b67f07e..6d486993dc980b27cdbacd9c4241dea07175af3f 100644 (file)
@@ -24,7 +24,7 @@ salt := "5RNqNl8iYLbkCc7JhR8as4TtDDCX6otuuWtcja8rITUyx9zrnHSe9tTHGmKK"        # 60 byte
 #  Hex encoded SSHA2-512 password
 #
 control += {
-       Password.With-Header = "{ssha512}%hex(%sha2_512(%{User-Password}%{salt}))%hex(%{salt})"
+       Password.With-Header = "{ssha512}%hex(%hash.sha2_512(%{User-Password}%{salt}))%hex(%{salt})"
 }
 
 pap.authorize
@@ -40,7 +40,7 @@ control := {}
 #
 #  Base64 encoded SSHA2-512 password
 #
-result_string := "%hex(%sha2_512(%{User-Password}%{salt}))%hex(%{salt})"
+result_string := "%hex(%hash.sha2_512(%{User-Password}%{salt}))%hex(%{salt})"
 
 # To Binary
 result_octets := "%bin(%{result_string})"
@@ -65,7 +65,7 @@ control := {}
 #
 #  Base64 of Base64 encoded SSHA2-512 password
 #
-result_string := "%hex(%sha2_512(%{User-Password}%{salt}))%hex(%{salt})"
+result_string := "%hex(%hash.sha2_512(%{User-Password}%{salt}))%hex(%{salt})"
 
 # To Binary
 result_octets := "%bin(%{result_string})"
@@ -90,7 +90,7 @@ control := {}
 #
 #  Base64 of SHA2-384 password (in SHA2-Password)
 #
-control.Password.SHA2 := %hex(%sha2_384(%{User-Password}))
+control.Password.SHA2 := %hex(%hash.sha2_384(%{User-Password}))
 
 pap.authorize
 pap.authenticate {
@@ -107,7 +107,7 @@ control := {
 #
 #  Base64 of SHA2-256 password (in SHA2-256-Password)
 #
-control.Password.SHA2-256 := "%hex(%sha2_256(%{User-Password}))"
+control.Password.SHA2-256 := "%hex(%hash.sha2_256(%{User-Password}))"
 
 pap.authorize
 pap.authenticate {
@@ -122,7 +122,7 @@ control := {}
 #
 #  Base64 of SHA2-224 password (in SHA2-224-Password - No hex armour)
 #
-control.Password.SHA2-224 := "%sha2_224(%{User-Password})"
+control.Password.SHA2-224 := "%hash.sha2_224(%{User-Password})"
 
 pap.authorize
 pap.authenticate {
index 1724af657fe12aa5b9c01428ffa03b07e822ad0e..02902ff2e40665575d5aa9dcd23b8ef497848c2b 100644 (file)
@@ -23,7 +23,7 @@ modules {
 
 
        csv {
-               key = "%tolower(%{User-Name})"
+               key = "%str.lower(%{User-Name})"
                filename = ${keyword}/csv.conf
                fields = "field1,,field3"
                index_field = 'field1'
index f2613c8edea1c3143d33743733fda2eed5a74bf5..9683ffedc640a5a6258a749b6c300c8eb32541de 100644 (file)
@@ -3,7 +3,7 @@ string result_string
 #
 #  Empty output on empty input
 #
-result_string := "%randstr(result_string)"
+result_string := "%str.rand(result_string)"
 if !(result_string == "") {
        test_fail
 }
@@ -11,19 +11,19 @@ if !(result_string == "") {
 #
 #  Check length of output
 #
-result_string := "%randstr('nnn')"
+result_string := "%str.rand('nnn')"
 if (!(%length(result_string) == 3)) {
        test_fail
 }
 
-result_string := %randstr('24a')
+result_string := %str.rand('24a')
 if (!(%length(result_string) == 24)) {
        test_fail
 }
 #
 #  Check maximum repetition
 #
-result_string := %randstr('1030aa')
+result_string := %str.rand('1030aa')
 if (!(%length(result_string) == 1025)) {
        test_fail
 }
@@ -31,7 +31,7 @@ if (!(%length(result_string) == 1025)) {
 #
 #  Check invalid character class
 #
-result_string := %randstr('G')
+result_string := %str.rand('G')
 
 if !(result_string == "") {
        test_fail
@@ -40,7 +40,7 @@ if !(result_string == "") {
 #
 #  Check repetition of binary output
 #
-result_string := %randstr('10b')
+result_string := %str.rand('10b')
 if (!(%length(result_string) == 10)) {
        test_fail
 }
index 98324d8d659e3db2b3e4cda0578d144746ef8a59..b3aafe4ac5b2f7c88e1c22e688e68e644fae0358 100644 (file)
@@ -37,7 +37,7 @@ if (!(result_octets == 0xda39a3ee5e6b4b0d3255bfef95601890afd80709)) {
 #
 #  SHA1 HMAC with attribute references
 #
-result_octets := %hmacsha1("%{test_hmac_key}", "%{test_hmac_data}")
+result_octets := %hmac.sha1("%{test_hmac_key}", "%{test_hmac_data}")
 if (!(result_octets == 0xeffcdf6ae5eb2fa2d27416d5f184df9c259a7c79)) {
        test_fail
 }
@@ -46,7 +46,7 @@ if (!(result_octets == 0xeffcdf6ae5eb2fa2d27416d5f184df9c259a7c79)) {
 #  SHA1 HMAC with empty key and data
 #
 dummy_string := ''
-result_octets := %hmacsha1("%{dummy_string}", "%{dummy_string}")
+result_octets := %hmac.sha1("%{dummy_string}", "%{dummy_string}")
 if (!(result_octets == 0xfbdb1d1b18aa6c08324b7d64b71fb76370690e1d)) {
        test_fail
 }
index fd3426a7dc9c5a1e1fcb208d0f066a2ac73fe21a..fb3b09915ea9ee8ede77afb018c7d55c7224f4e2 100644 (file)
@@ -5,7 +5,7 @@ test_string := "hello"
 #
 #  SHA1 HMAC with missing key should fail
 #
-result_octets := %hmacsha1(%{test_string}, ) # ERROR
+result_octets := %hmac.sha1(%{test_string}, ) # ERROR
 if result_octets {
        test_fail
 }
index 27345564d7e7a85e9e5642574deecf64a0d88183..a3c8593ae786d53384348a5c2b684ea6dcd1a692 100644 (file)
@@ -13,12 +13,12 @@ test_octets := 0x000504030201
 #  Put "This is a string" into a file and call "sha2_256sum" on it.
 #  You should get this string.
 #
-result_octets := %sha2_256("This is a string\n")
+result_octets := %hash.sha2_256("This is a string\n")
 if (!(result_octets == 0xb3716a1ab53042bb392034f29071e13b0c38aa19b4edd75d9a76022f91189124)) {
        test_fail
 }
 
-result_octets := %sha2_256(%{test_string})
+result_octets := %hash.sha2_256(%{test_string})
 if (!(result_octets == 0xb3716a1ab53042bb392034f29071e13b0c38aa19b4edd75d9a76022f91189124)) {
        test_fail
 }
@@ -26,7 +26,7 @@ if (!(result_octets == 0xb3716a1ab53042bb392034f29071e13b0c38aa19b4edd75d9a76022
 #
 #  SHA256 should also be able to cope with references to octet attributes
 #
-result_octets := %sha2_256(%{test_octets})
+result_octets := %hash.sha2_256(%{test_octets})
 if (!(result_octets == 0xf307e202b881fded70e58017aa0c4d7b29c76ab25d02bf078301a5f6635187eb)) {
        test_fail
 }
@@ -34,7 +34,7 @@ if (!(result_octets == 0xf307e202b881fded70e58017aa0c4d7b29c76ab25d02bf078301a5f
 #
 # SHA256 of empty string
 #
-result_octets := %sha2_256(%{dummy_octets})
+result_octets := %hash.sha2_256(%{dummy_octets})
 if (!(result_octets == 0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855)) {
        test_fail
 }
@@ -43,17 +43,17 @@ if (!(result_octets == 0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991
 #  SHA512 and SHA256 share common code paths, so the tests don't need to be
 #  as exhaustive.
 #
-result_octets := %sha2_512("This is a string\n")
+result_octets := %hash.sha2_512("This is a string\n")
 if (!(result_octets == 0x56b57df5cce42d4e35c644649798ea23ec16f4f4626e78faf4d2d8f430ea349bcc28cd5532457c82f0aa66bf68988346039fe75b900a92ff94fd53993d45990f)) {
        test_fail
 }
 
-result_octets := %sha2_512(%{test_string})
+result_octets := %hash.sha2_512(%{test_string})
 if (!(result_octets == 0x56b57df5cce42d4e35c644649798ea23ec16f4f4626e78faf4d2d8f430ea349bcc28cd5532457c82f0aa66bf68988346039fe75b900a92ff94fd53993d45990f)) {
        test_fail
 }
 
-result_octets := %sha2_512(%{test_octets})
+result_octets := %hash.sha2_512(%{test_octets})
 if (!(result_octets == 0xde80271eb5e03a1c24dd0cd823a22305a743ee3a54f1de5bf97adbf56984561154bfb6928b1da4ccc3f5dde9f4032ad461937b60b9ace4ad3898cf45c90596d7)) {
        test_fail
 }
index a6a35981194ecad6741930be301011713dbf237f..114c74dde6915c645474736014b33592471989e7 100644 (file)
@@ -9,47 +9,47 @@ test_string = "hello world"
 test_octets = 0x01234567
 test_int = 123456
 
-if !(%substr(%{test_string}, 1, 3) == 'ell') {
+if !(%str.substr(%{test_string}, 1, 3) == 'ell') {
        test_fail
 }
 
-if !(%substr(%{test_string}, 0, 3) == 'hel') {
+if !(%str.substr(%{test_string}, 0, 3) == 'hel') {
        test_fail
 }
 
-if !(%substr(%{test_string}, 5) == ' world') {
+if !(%str.substr(%{test_string}, 5) == ' world') {
        test_fail
 }
 
-if !(%substr(%{test_string}, -3) == 'rld') {
+if !(%str.substr(%{test_string}, -3) == 'rld') {
        test_fail
 }
 
-if !(%substr(%{test_string}, -20) == 'hello world') {
+if !(%str.substr(%{test_string}, -20) == 'hello world') {
        test_fail
 }
 
-if !(%substr(%{test_string}, -4, 2) == 'or') {
+if !(%str.substr(%{test_string}, -4, 2) == 'or') {
        test_fail
 }
 
-if !(%substr(%{test_string}, -10, -3) == 'ello wo') {
+if !(%str.substr(%{test_string}, -10, -3) == 'ello wo') {
        test_fail
 }
 
-if (%substr(%{test_string}, 20)) {
+if (%str.substr(%{test_string}, 20)) {
        test_fail
 }
 
-if (%substr(%{test_string}, 5, -7)) {
+if (%str.substr(%{test_string}, 5, -7)) {
        test_fail
 }
 
-if !(%substr(%{test_octets}, 1, 2) == 0x2345) {
+if !(%str.substr(%{test_octets}, 1, 2) == 0x2345) {
        test_fail
 }
 
-if !(%substr(%{test_int}, 1, 2) == '23') {
+if !(%str.substr(%{test_int}, 1, 2) == '23') {
        test_fail
 }
 
index b40fd4a78bedcdeb34a6b144426730c26a0ebacc..82ff6fb08223764075b6a85818af5074a590a5c0 100644 (file)
@@ -1,7 +1,7 @@
 string test_string
 test_string := 'foo'
 
-switch "%tolower(%{test_string})" {
+switch "%str.lower(%{test_string})" {
        case 'foo' {
                success
        }
index 175f082fa66553d1da4a8bf17f959f58c3bddd23..544328c4101969a26dfdb992db8baae099c53a63 100644 (file)
@@ -5,13 +5,13 @@ string test_string
 string dummy_string
 
 test_string    := "AbCdE"
-test_string    := %tolower(test_string)
+test_string    := %str.lower(test_string)
 
 if !(test_string == "abcde") {
        test_fail
 }
 
-test_string    := %tolower('AAbbCCdd')
+test_string    := %str.lower('AAbbCCdd')
 if !(test_string == "aabbccdd") {
        test_fail
 }
@@ -19,7 +19,7 @@ if !(test_string == "aabbccdd") {
 #
 #  Doesn't exist
 #
-test_string    := "%tolower(dummy_string)"
+test_string    := "%str.lower(dummy_string)"
 if !(test_string == "") {
        test_fail
 }
index dfccc039c9a3472190a5234b80957994dc4976e0..540c37b138716ef06ef5d0114a440b7c963bd7e9 100644 (file)
@@ -5,17 +5,17 @@ string test_string
 string dummy_string
 
 test_string    := "AbCdE"
-test_string    := %toupper(test_string)
+test_string    := %str.upper(test_string)
 if (!(test_string == "ABCDE")) {
        test_fail
 }
 
-test_string    := %toupper('AAbbCCdd')
+test_string    := %str.upper('AAbbCCdd')
 if (!(test_string == "AABBCCDD")) {
        test_fail
 }
 
-test_string    := "%toupper(dummy_string)"
+test_string    := "%str.upper(dummy_string)"
 if !(test_string == "") {
        test_fail
 }
index 2e76e71525f65a9b26285c6474bb0b3f1e5cb896..2c66a266bbb7a03f52b8f2b8605b374bf1ec8973 100644 (file)
@@ -15,37 +15,37 @@ test_string3 = '™œ¥¤'
 encoded_string2 := '%C2%B1%C2%A7%21%40%23%24%25%5E%26%2A%28%29%2B%3D%7B%5B%7D%5D%3A%3B%22%27%7C%5C%3C%2C%3E%3F%2F%60'
 encoded_string3 := '%E2%84%A2%C5%93%C2%A5%C2%A4'
 
-result_string = "%urlquote(%{test_string1})"
+result_string = "%url.quote(%{test_string1})"
 if (!(result_string == test_string1)) {
        test_fail
 }
 
-result_string := "%urlunquote(%{test_string1})"
+result_string := "%url.unquote(%{test_string1})"
 if (!(result_string == test_string1)) {
        test_fail
 }
 
-result_string := "%urlquote(%{test_string2})"
+result_string := "%url.quote(%{test_string2})"
 if (!(result_string == encoded_string2)) {
        test_fail
 }
 
-result_string := "%urlquote(%{test_string3})"
+result_string := "%url.quote(%{test_string3})"
 if (!(result_string == encoded_string3)) {
        test_fail
 }
 
-result_string := "%urlunquote(%{encoded_string2})"
+result_string := "%url.unquote(%{encoded_string2})"
 if (!(result_string == test_string2)) {
        test_fail
 }
 
-result_string := "%urlunquote(%{encoded_string3})"
+result_string := "%url.unquote(%{encoded_string3})"
 if (!(result_string == test_string3)) {
        test_fail
 }
 
-result_string := "%urlunquote('%%E, 123')"
+result_string := "%url.unquote('%%E, 123')"
 
 # Test decoding invalid encoded string
 if !(result_string == "") {
index f78cbbcab0c4068f08250a7b7e153711576ceecd..1b31c0206d7784fb269805b003a459d77b78a295 100644 (file)
@@ -19,7 +19,7 @@ if (!("%{Framed-IP-Address[*]}" == '192.0.2.1192.0.2.2')) {
 request += {
        NAS-IP-Address = Framed-IP-Address[1]
        NAS-IP-Address = Framed-IP-Address[0]
-       Filter-Id = "%concat(%{Framed-IP-Address[*]}, ',')"
+       Filter-Id = "%str.concat(%{Framed-IP-Address[*]}, ',')"
        NAS-Port = %{Framed-IP-Address[#]}
 }
 
index 0586034eb8a606f6e0a57735d4424345c478728e..64b3e339066399a9ba8e268de1b4e45fbdeeb1c5 100644 (file)
@@ -8,7 +8,7 @@ if !("\%{ FOO}" == '%{ FOO}') {
        test_fail
 }
 
-if !(%tolower("\%{FOO}") == '%{foo}') {
+if !(%str.lower("\%{FOO}") == '%{foo}') {
        test_fail
 }
 
index ed710db99ce12720a4d709eec0abcc73531706c5..f879f27f3e9841a4e4e38f3310fcee7ee182febc 100644 (file)
@@ -17,27 +17,27 @@ control += {
        Filter-Id = 'here.  are . some.  words. '
 }
 
-result_string := "%concat(%explode(Class, '|'), ',')"
+result_string := "%str.concat(%str.split(Class, '|'), ',')"
 if (!(result_string == "1=1,my_attr=2,my_attr=hello")) {
        test_fail
 }
 
-result_string := "%concat(%explode(Calling-Station-ID, '|'), ',')"
+result_string := "%str.concat(%str.split(Calling-Station-ID, '|'), ',')"
 if (!(result_string == "")) {
        test_fail
 }
 
-result_string := "%concat(%explode(control.User-Name[*], '|'), ',')"
+result_string := "%str.concat(%str.split(control.User-Name[*], '|'), ',')"
 if (!(result_string == "hello,goodbye,morning,night,1")) {
        test_fail
 }
 
-result_string := "%concat(%explode(control.Reply-Message, '|'), ',')"
+result_string := "%str.concat(%str.split(control.Reply-Message, '|'), ',')"
 if !(result_string == 'Can\'t touch this') {
        test_fail
 }
 
-result_string := "%concat(%explode(control.Filter-Id, '. '), ',')"
+result_string := "%str.concat(%str.split(control.Filter-Id, '. '), ',')"
 if !(result_string == 'here, are ,some, words') {
        test_fail
 }
index d98df841f065da418553e597fad1ae9a3560ec23..8afb8205e4e2e5851df1d0e762d77c329c5ea60a 100644 (file)
@@ -31,7 +31,7 @@ if ("%{control.[*]}" != '192.0.2.1192.0.2.2') {
 request += {
        NAS-IP-Address = %{control.[1]}
        NAS-IP-Address = %{control.[0]}
-       Filter-Id       = %concat(%{control.[*]}, ',')
+       Filter-Id       = %str.concat(%{control.[*]}, ',')
        NAS-Port = %{control.[#]}
 }
 
index 907deaf01f7a4e687e6c5eb9dcb63a5ae468fc9e..ba8b724cf6982731a894254c6b9a15ef89d85c64 100644 (file)
@@ -2,18 +2,18 @@
 #
 #  PRE: if
 #
-if (%concat(%test1.passthrough('foo', 'bar'),'|') != "foo|bar") {
+if (%str.concat(%test1.passthrough('foo', 'bar'),'|') != "foo|bar") {
        test_fail
 }
 
-if (%concat(%test2.passthrough('foo', 'bar'), '|') != "foo|bar") {
+if (%str.concat(%test2.passthrough('foo', 'bar'), '|') != "foo|bar") {
        test_fail
 }
 
 #
 #  The config has a "redundant" block for test1 and test2.
 #
-if (%concat(%redundant_test.passthrough('foo', 'bar'), '|') != "foo|bar") {
+if (%str.concat(%redundant_test.passthrough('foo', 'bar'), '|') != "foo|bar") {
        test_fail
 }
 
index 4c6b6571ed6800f560f7072f79839ad10ff83e6f..5d6fc4fe908ed97239752c4fc5269e4a3910b329 100644 (file)
@@ -194,7 +194,7 @@ server test {
        load Cookie {
                string csn
 
-               csn := %concat(%ldap("ldap:///%ldap.uri.safe(%{LDAP-Sync.Directory-Root-DN})?contextCSN?base"), ';')
+               csn := %str.concat(%ldap("ldap:///%ldap.uri.safe(%{LDAP-Sync.Directory-Root-DN})?contextCSN?base"), ';')
                reply.LDAP-Sync.Cookie := "rid=000,csn=%{csn}"
        }
 
index faaf8a77960544fe373e64efd74984dacefd9493..f09f678bd5d2fd357e3b901968a75c71813803f7 100644 (file)
@@ -56,5 +56,5 @@ exec exec_sync_xlat_args {
        wait = yes
        output_pairs = control
        timeout = 10
-       program = "/bin/sh $ENV{MODULE_TEST_DIR}/attrs.sh %toupper(%{User-Name})"
+       program = "/bin/sh $ENV{MODULE_TEST_DIR}/attrs.sh %str.upper(%{User-Name})"
 }
index b3227e51b10c1f4c9ea5473b38fd95e3ef4ddbe1..8ecc37a3f61ef1ff62c4917beb32951afc9a6ff2 100644 (file)
@@ -156,7 +156,7 @@ undo        Password.Cleartext := "hello"
 #  otherwise it's a compile-time error.
 #
 undo
-       Framed-IP-Address := "hello %md5('foo')"
+       Framed-IP-Address := "hello %hash.md5('foo')"
 
 #
 #  Test where additional checks uses the [*] filter
index 9580968bef390085f7156a7e617f951266eebc10..ad2681a8bb07fc5a09b3e68b0d0cfe6ae6276ce3 100644 (file)
@@ -330,7 +330,7 @@ ldap {
                        update {
                                description := "User %{User-Name} authenticated"
                                userPKCS12 := Class
-                               carLicense += "%randstr('CCnnCCC')"
+                               carLicense += "%str.rand('CCnnCCC')"
                        }
                }
        }
index 9d783fa5d59c48c5fce9287c4b79986d0dfc9a56..9b0f4d4901a9328d24c5d964493dc9322df9db1e 100644 (file)
@@ -1,5 +1,5 @@
 if (User-Name == 'test') {
-       User-Password := "%randstr('bbbbbbbbbbbbbbbb')"
+       User-Password := "%str.rand('bbbbbbbbbbbbbbbb')"
        control.Password.Cleartext := "%{User-Password}"
 
        pap.authorize
index 28613142f1df379e3610a356b0af5085ac846edf..5276c520f4fbef9b0be6549fdfe14c7d5fb9ff8c 100644 (file)
@@ -14,9 +14,9 @@ $INCLUDE cluster_reset.inc
 #  - 127.0.0.1:30005 - slave
 #  - 127.0.0.1:30003 - master [10923-16383]
 #  - 127.0.0.1:30006 - slave
-testdata1 := "1-%randstr('aaaaaaaa')"
-testdata2 := "2-%randstr('aaaaaaaa')"
-testdata3 := "3-%randstr('aaaaaaaa')"
+testdata1 := "1-%str.rand('aaaaaaaa')"
+testdata2 := "2-%str.rand('aaaaaaaa')"
+testdata3 := "3-%str.rand('aaaaaaaa')"
 
 #  Hashes to Redis cluster node master 1 (1)
 if (%redis('SET', 'b', %{testdata1}) == 'OK') {
index ff48c651f465da7355e56fc707e86d8c6cc04824..ee47d319619624c5c21b8645a16f1c84d76a6057 100644 (file)
@@ -8,9 +8,9 @@ string data2
 string data3
 string cmdresult
 
-data1 := "1-%randstr('aaaaaaaa')"
-data2 := "2-%randstr('aaaaaaaa')"
-data3 := "3-%randstr('aaaaaaaa')"
+data1 := "1-%str.rand('aaaaaaaa')"
+data2 := "2-%str.rand('aaaaaaaa')"
+data3 := "3-%str.rand('aaaaaaaa')"
 
 if ("$ENV{REDIS_CLUSTER_CONTROL}" == '') {
        clusterctrl := 'scripts/ci/redis-setup.sh'
index 45130d94d08c0e4172256f9bca4438a8008ed757..66647e760dea6d45497cd17a3d31e020c45ea1b5 100644 (file)
@@ -240,23 +240,23 @@ match ERROR offset 12: Attribute 'X' not found in namespace 'internal': Unresolv
 condition (ipaddr)127.0.0.1 == "127.0.0.1"
 match true
 
-condition (ipaddr)127.0.0.1 == "%md4(' 127.0.0.1')"
-match (127.0.0.1 == "%md4(0x203132372e302e302e31)")
+condition (ipaddr)127.0.0.1 == "%hash.md4(' 127.0.0.1')"
+match (127.0.0.1 == "%hash.md4(0x203132372e302e302e31)")
 
 #
 #  Bare %{...} is allowed.
 #
-condition (ipaddr)127.0.0.1 == %md4('127.0.0.1')
-match (127.0.0.1 == %md4(0x3132372e302e302e31))
+condition (ipaddr)127.0.0.1 == %hash.md4('127.0.0.1')
+match (127.0.0.1 == %hash.md4(0x3132372e302e302e31))
 
-condition (ipaddr)127.0.0.1 == %md4("SELECT user FROM table WHERE user='%{User-Name}'")
-match (127.0.0.1 == %md4("SELECT user FROM table WHERE user='%{User-Name}'"))
+condition (ipaddr)127.0.0.1 == %hash.md4("SELECT user FROM table WHERE user='%{User-Name}'")
+match (127.0.0.1 == %hash.md4("SELECT user FROM table WHERE user='%{User-Name}'"))
 
 condition (ether) 00:11:22:33:44:55 == "00:11:22:33:44:55"
 match true
 
-condition (ether) 00:11:22:33:44:55 == "%md4('00:11:22:33:44:55')"
-match (00:11:22:33:44:55 == "%md4(0x30303a31313a32323a33333a34343a3535)")
+condition (ether) 00:11:22:33:44:55 == "%hash.md4('00:11:22:33:44:55')"
+match (00:11:22:33:44:55 == "%hash.md4(0x30303a31313a32323a33333a34343a3535)")
 
 condition (ether) 00:XX:22:33:44:55 == 00:11:22:33:44:55
 match ERROR offset 10: Unexpected text after attribute reference
@@ -309,11 +309,11 @@ match true
 condition ('foo' == 'foo')
 match true
 
-condition ("foo" == "%md4(' foo')")
-match ("foo" == "%md4(0x20666f6f)")
+condition ("foo" == "%hash.md4(' foo')")
+match ("foo" == "%hash.md4(0x20666f6f)")
 
-condition ("foo bar" == "%md4(' foo')")
-match ("foo bar" == "%md4(0x20666f6f)")
+condition ("foo bar" == "%hash.md4(' foo')")
+match ("foo bar" == "%hash.md4(0x20666f6f)")
 
 condition ("foo" == "bar")
 match false
@@ -329,8 +329,8 @@ match false
 condition (User-Name == "bob")
 match (User-Name == "bob")
 
-condition (User-Name == "%md4(' blah')")
-match (User-Name == "%md4(0x20626c6168)")
+condition (User-Name == "%hash.md4(' blah')")
+match (User-Name == "%hash.md4(0x20626c6168)")
 
 condition (ipaddr)127.0.0.1 == 2130706433
 match true
@@ -418,8 +418,8 @@ match ("foo" == User-Name)
 #  We should really add a "cast print" function which prints
 #  out the casts in the same format in which they are parsed.
 #
-condition (integer)"%md4(' 1 + 1')" < NAS-Port
-match (%cast(uint32, "%md4(0x2031202b2031)") < NAS-Port)
+condition (integer)"%hash.md4(' 1 + 1')" < NAS-Port
+match (%cast(uint32, "%hash.md4(0x2031202b2031)") < NAS-Port)
 
 condition Filter-Id == Framed-IP-Address
 match (Filter-Id == Framed-IP-Address)
index 8a852d80b9991bb573092e79dd72882de900b523..d574ce9567e0fa776fe947a92a056904dbe282ef 100644 (file)
@@ -90,8 +90,8 @@ match ERROR offset 2: Invalid regex reference.  Must be in range 0-32
 condition User-Name == /foo/
 match ERROR offset 13: Unexpected regular expression
 
-condition %md5("foo") =~ /foo/
-match ((string)%md5(0x666f6f) =~ /foo/)
+condition %hash.md5("foo") =~ /foo/
+match ((string)%hash.md5(0x666f6f) =~ /foo/)
 
 count
 match 50
index 426475120714112c4e9c3e721ac9f2f123b4eafc..3d41d08d88d4727007d47bece559e9cfb56fc151 100644 (file)
@@ -262,8 +262,8 @@ match ERROR offset 7: Invalid argument 1 - Failed parsing string as type 'int8'
 #
 #  This is correct.
 #
-xlat %rpad(User-Name, 5, 'x')
-match %rpad(User-Name, 5, 'x')
+xlat %str.rpad(User-Name, 5, 'x')
+match %str.rpad(User-Name, 5, 'x')
 
 #
 #  The second argument should be an integer.
@@ -271,14 +271,14 @@ match %rpad(User-Name, 5, 'x')
 #  @todo - parsing - we don't currently track string offsets for intermediate nodes,
 #  so the "offset" is wrong.  It also doesn't say *which* string is wrong.  We'll fix that later.
 #
-xlat %rpad(User-Name, 'foo', 'x')
-match ERROR offset 17: Invalid argument 2 - Failed parsing string as type 'uint64'
+xlat %str.rpad(User-Name, 'foo', 'x')
+match ERROR offset 21: Invalid argument 2 - Failed parsing string as type 'uint64'
 
 #
 #  Argument quoting
 #
-xlat %md5('"arg"')
-match %md5(0x2261726722)
+xlat %hash.md5('"arg"')
+match %hash.md5(0x2261726722)
 
 #
 #  Arguably this should be a parse error.  There's trailing text "}
@@ -288,20 +288,20 @@ match %md5(0x2261726722)
 #  escape_rules_double, but does NOT look for leading or trailing ".  AND it
 #  doesn't pass in a terminal which says to stop at ".
 #
-xlat %md5('"arg')"}
-match %md5(0x22617267)\"}
+xlat %hash.md5('"arg')"}
+match %hash.md5(0x22617267)\"}
 
-xlat %md5('"arg')
-match %md5(0x22617267)
+xlat %hash.md5('"arg')
+match %hash.md5(0x22617267)
 
-xlat %md5('"arg\""')
-match %md5(0x226172675c2222)
+xlat %hash.md5('"arg\""')
+match %hash.md5(0x226172675c2222)
 
-xlat %md5('arg')
-match %md5(0x617267)
+xlat %hash.md5('arg')
+match %hash.md5(0x617267)
 
-xlat %md5('arg"')
-match %md5(0x61726722)
+xlat %hash.md5('arg"')
+match %hash.md5(0x61726722)
 
 count
 match 161
index a06aa1acea55081f079f0698055c6c803de68348..01243d8cd87107cb33c91855177da67e28cc159f 100644 (file)
@@ -256,19 +256,19 @@ match true
 #
 #  The MD4 output isn't a valid IP address or prefix.
 #
-xlat_purify (ipaddr)127.0.0.1 == "%md4(' 127.0.0.1')"
+xlat_purify (ipaddr)127.0.0.1 == "%hash.md4(' 127.0.0.1')"
 match ERROR purifying node - Failed to parse IPv4 prefix string "/"
 
-xlat_purify (ipaddr)127.0.0.1 == %md4('127.0.0.1')
+xlat_purify (ipaddr)127.0.0.1 == %hash.md4('127.0.0.1')
 match ERROR purifying node - Invalid cast from octets to ipaddr.  Needed octet string of length 4, got 16
 
-xlat_purify (ipaddr)127.0.0.1 == %md4("SELECT user FROM table WHERE user='%{User-Name}'")
-match (127.0.0.1 == %md4("SELECT user FROM table WHERE user='%{User-Name}'"))
+xlat_purify (ipaddr)127.0.0.1 == %hash.md4("SELECT user FROM table WHERE user='%{User-Name}'")
+match (127.0.0.1 == %hash.md4("SELECT user FROM table WHERE user='%{User-Name}'"))
 
 xlat_purify (ether) 00:11:22:33:44:55 == "00:11:22:33:44:55"
 match true
 
-xlat_purify (ether)00:11:22:33:44:55 == "%md4('00:11:22:33:44:55')"
+xlat_purify (ether)00:11:22:33:44:55 == "%hash.md4('00:11:22:33:44:55')"
 match ERROR purifying node - Missing separator, expected ':'
 
 xlat_purify (ether) 00:XX:22:33:44:55 == 00:11:22:33:44:55
@@ -315,10 +315,10 @@ match true
 #
 #  MD4 hash is not equal to other things
 #
-xlat_purify ("foo" == "%md4(' foo')")
+xlat_purify ("foo" == "%hash.md4(' foo')")
 match false
 
-xlat_purify ("foo bar" == "%md4(' foo')")
+xlat_purify ("foo bar" == "%hash.md4(' foo')")
 match false
 
 xlat_purify ("foo" == "bar")
@@ -335,11 +335,11 @@ match false
 xlat_purify (User-Name == "bob")
 match (User-Name == "bob")
 
-xlat_purify (User-Name == %md4(' blah'))
+xlat_purify (User-Name == %hash.md4(' blah'))
 match (User-Name == 0x544924d05ec4481925ba3749a096a0a7)
 
 #  and without the double quotes.
-xlat_purify (User-Name == %md4(' blah'))
+xlat_purify (User-Name == %hash.md4(' blah'))
 match (User-Name == 0x544924d05ec4481925ba3749a096a0a7)
 
 xlat_purify (ipaddr)127.0.0.1 == 2130706433
@@ -430,7 +430,7 @@ match ("foo" == User-Name)
 #
 #  ERROR: Failed casting 0x002ade8665c69219ca16bd108d92c8d5 to data type uint32: Invalid cast from octets to uint32.  Source length 16 is greater than destination type size 4
 #
-xlat_purify (integer)"%md4(' 1 + 1')" < NAS-Port
+xlat_purify (integer)"%hash.md4(' 1 + 1')" < NAS-Port
 match ERROR purifying node - 
 
 #
index b0a8a5fc334b8f6a1d4fb896ad1574e3220d1929..e8a878b71d30fa4beeaed05a85c0925677d18430 100644 (file)
@@ -93,8 +93,8 @@ match ((1 < 2) || (4 > 3) || (4 == 4) || (1 < 2))
 xlat_expr Filter-Id
 match Filter-Id
 
-xlat_expr %md5('foo') + "foo"
-match (%md5(0x666f6f) + "foo")
+xlat_expr %hash.md5('foo') + "foo"
+match (%hash.md5(0x666f6f) + "foo")
 
 #  We can name the xlat's, tho we don't need to
 xlat_expr %op_add(4, 3) + 6
@@ -110,8 +110,8 @@ match (1 < 2)
 xlat_expr 1 < 2 < 3
 match ((1 < 2) < 3)
 
-xlat_expr (uint32) %concat(1, 2)
-match (uint32)%concat(1, 2)
+xlat_expr (uint32) %str.concat(1, 2)
+match (uint32)%str.concat(1, 2)
 
 #
 # Mashing multiple brackets together.  The brackets are removed as
index ef7d614ef52cf40fea6eed53b4ad9637d7d496b1..2b1c5ef550e3d66b850c86719bbd8f5169e27f8b 100644 (file)
@@ -11,10 +11,10 @@ migrate xlat_new_functions = yes
 xlat %Y()
 match %Y
 
-xlat %explode("a,b,c,d", ',')
-match %explode("a,b,c,d", ',')
+xlat %str.split("a,b,c,d", ',')
+match %str.split("a,b,c,d", ',')
 
-#xlat %md5(foo)
+#xlat %hash.md5(foo)
 #match foo
 
 count
index cc4ce2ce931b8841fdb4bd0097689124405cb743..f126064366f8cfc84c1bb5cf5985c5827ef34040 100644 (file)
@@ -121,7 +121,7 @@ match 2
 xlat_purify Filter-Id
 match Filter-Id
 
-xlat_purify %md5('foo') + "bar"
+xlat_purify %hash.md5('foo') + "bar"
 match 0xacbd18db4cc2f85cedef654fccc4a4d8626172
 
 #  We can name the xlat's, tho we don't need to
@@ -235,37 +235,37 @@ match "hello 3 bob"
 #
 migrate xlat_new_functions = yes
 
-xlat_purify %md5('foo')
+xlat_purify %hash.md5('foo')
 match 0xacbd18db4cc2f85cedef654fccc4a4d8
 
-xlat_purify %explode("a,b,c,d", ',')
+xlat_purify %str.split("a,b,c,d", ',')
 match "a""b""c""d"
 
-xlat_purify %md5('foo')
+xlat_purify %hash.md5('foo')
 match 0xacbd18db4cc2f85cedef654fccc4a4d8
 
-xlat_purify %md5(%md5('foo'))
+xlat_purify %hash.md5(%hash.md5('foo'))
 match 0x47847ae721df523d6388aebc9c94d656
 
-xlat_purify %md5('%md5(foo)')
-match 0x5e153571422b69cf5c5f7ce5f03985b5
+xlat_purify %hash.md5('%hash.md5(foo)')
+match 0xb98c435f641b131d05637746d30c62db
 
 #
 #  Constant string
 #
-xlat_purify %md5('%{User-Name}')
+xlat_purify %hash.md5('%{User-Name}')
 match 0x892e91c7b175ab41826c9cb88eebf27a
 
 #
 #  This is a reference to the contents of User-Name
 #
-xlat_purify %md5(%{User-Name})
-match %md5(%{User-Name})
+xlat_purify %hash.md5(%{User-Name})
+match %hash.md5(%{User-Name})
 
-xlat_purify %md5('foo')
+xlat_purify %hash.md5('foo')
 match 0xacbd18db4cc2f85cedef654fccc4a4d8
 
-xlat_purify %md5("foo")
+xlat_purify %hash.md5("foo")
 match 0xacbd18db4cc2f85cedef654fccc4a4d8
 
 count
index 01f8fcd0d1b13e934f6a94169c0802c3012a6894..ead2644103e216ab3034e02ae29b4e9190e8f05f 100644 (file)
@@ -145,20 +145,20 @@ match bob
 #
 #  We're not hashing the string value of the attribute reference
 #
-xlat_expr (octets) %md5('&User-Name')
+xlat_expr (octets) %hash.md5('&User-Name')
 match 0x14d23a6ed8e7d19fcb3a38dc86c1fc0b
 
 #
 #  We're hashing the string contained by the User-Name
 #
-xlat_expr (octets) %md5('bob')
+xlat_expr (octets) %hash.md5('bob')
 match 0x9f9d51bc70ef21ca5c14f307980a29d8
 
 #
 #  And if we take it from the &User-Name ref, we get the same thing
 #  as hashing the bare string.
 #
-xlat_expr (octets) %md5(%{User-Name})
+xlat_expr (octets) %hash.md5(%{User-Name})
 match 0x9f9d51bc70ef21ca5c14f307980a29d8
 
 xlat_expr &Service-Type