From: Alan T. DeKok Date: Fri, 15 Sep 2023 12:52:01 +0000 (-0400) Subject: start removing "update" X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e98ba1a57ebd594b8407e962b34a6e3198a64a08;p=thirdparty%2Ffreeradius-server.git start removing "update" --- diff --git a/doc/antora/modules/reference/pages/xlat/builtin.adoc b/doc/antora/modules/reference/pages/xlat/builtin.adoc index a55eec14349..ab1b2c39e4b 100644 --- a/doc/antora/modules/reference/pages/xlat/builtin.adoc +++ b/doc/antora/modules/reference/pages/xlat/builtin.adoc @@ -21,14 +21,12 @@ the attributes data as encoded "on the wire". ==== [source,unlang] ---- -update control { - &Tmp-String-0 := "Caipirinha" - &Framed-IP-Address := 192.0.2.1 -} +&Tmp-String-0 := "Caipirinha" +&Framed-IP-Address := 192.0.2.1 -update reply { - &Reply-Message := "The length of %{control.Tmp-String-0} is %(length:&control.Tmp-String-0)" - &Reply-Message += "The length of %{control.Framed-IP-Address} is %(length:&control.Framed-IP-Address)" +&reply += { + &Reply-Message = "The length of %{control.Tmp-String-0} is %(length:&control.Tmp-String-0)" + &Reply-Message = "The length of %{control.Framed-IP-Address} is %(length:&control.Framed-IP-Address)" } ---- @@ -64,12 +62,8 @@ unsigned 32-bit number. ==== [source,unlang] ---- -update { - &control.Service-Type := Login-User -} -update reply { - &Reply-Message := "The value of Service-Type is %(integer:%{control.Service-Type})" -} +&control.Service-Type := Login-User +&reply.Reply-Message := "The value of Service-Type is %(integer:%{control.Service-Type})" ---- .Output @@ -89,9 +83,7 @@ Generate random number from `0` to `-1`. ==== [source,unlang] ---- -update reply { - &Reply-Message := "The random number is %{rand:512}" -} +&reply.Reply-Message := "The random number is %{rand:512}" ---- .Output @@ -101,38 +93,6 @@ The random number is 347 ``` ==== -=== %{tag:} - -CAUTION: This expansion is deprecated and will likely be removed. - -Returns a list of tags for any attributes found using ````. - -.Return: _int8_ - -.Determining the tag value of the second instance of the `radius.Tunnel-Server-Endpoint` attribute -==== -[source,unlang] ----- -update request { - &Tunnel-Server-Endpoint := '192.0.1.1' - &Tunnel-Server-Endpoint:1 := '192.0.5.2' - &Tunnel-Server-Endpoint:1 += '192.0.3.8' - &Tunnel-Server-Endpoint:2 := '192.0.2.1' - &Tunnel-Server-Endpoint:2 += '192.0.3.4' -} - -update reply { - &Reply-Message := "The tag value of the second instance of Tunnel-Server-Enpoint is %{request.Tunnel-Server-Endpoint[1]}" -} ----- - -.Output - -``` -The tag value of the second instance of Tunnel-Server-Enpoint is 192.0.5.2 -``` -==== - === %{string:} Convert input to a string if (possible). For _octets_ type @@ -432,15 +392,15 @@ Used to join two or more attributes, separated by an optional delimiter. [source,unlang] ---- -update { - &control.Tmp-String-0 := "aaa" - &control.Tmp-String-0 += "bb" - &control.Tmp-String-0 += "c" +&control += { + &Tmp-String-0 = "aaa" + &Tmp-String-0 = "bb" + &Tmp-String-0 = "c" } -update reply { - &Reply-Message += "%(concat:%{control.Tmp-String-0[*]} ', ')" - &Reply-Message += "%(concat:%{control.Tmp-String-0[*]} ,)" +reply += { + &Reply-Message = "%(concat:%{control.Tmp-String-0[*]} ', ')" + &Reply-Message = "%(concat:%{control.Tmp-String-0[*]} ,)" } ---- @@ -463,17 +423,11 @@ This expansion is the opposite of `%(concat: ... )`. [source,unlang] ---- -update control { - &Tmp-String-0 := "bob.toba@domain.com" -} +&control.Tmp-String-0 := "bob.toba@domain.com" -update control { - &Tmp-String-1 := "%(explode:&control.Tmp-String-0 @)" -} +&control.Tmp-String-1 := "%(explode:&control.Tmp-String-0 @)" -update reply { - &Reply-Message := "Welcome %{control.Tmp-String-1[0]}" -} +&reply.Reply-Message := "Welcome %{control.Tmp-String-1[0]}" ---- .Output @@ -492,12 +446,9 @@ Left-pad a string. [source,unlang] ---- -update control { - &Tmp-String-0 := "123" -} -update reply { - &Reply-Message := "Maximum should be %(lpad:%{control.Tmp-String-0} 11 0)" -} +&control.Tmp-String-0 := "123" + +&reply.Reply-Message := "Maximum should be %(lpad:%{control.Tmp-String-0} 11 0)" ---- .Output @@ -516,12 +467,9 @@ Right-pad a string. [source,unlang] ---- -update control { - &Tmp-String-0 := "123" -} -update reply { - &Reply-Message := "Maximum should be %(rpad:%{control.Tmp-String-0} 11 0)" -} +&control.Tmp-String-0 := "123" + +&reply.Reply-Message := "Maximum should be %(rpad:%{control.Tmp-String-0} 11 0)" ---- .Output @@ -983,7 +931,7 @@ Evaluates the string as an expansion, and returns the result. The main differen .Return: _data_ -.Example: +.Example [source,unlang] ---- @@ -1060,7 +1008,7 @@ Calculate number of seconds until next n hour(`s`), day(`s`), week(`s`), year(`s .Return: _string_ -.Example: +.Example With the current time at 16:18, `%(nexttime:1h)` will expand to `2520`. @@ -1088,7 +1036,7 @@ See also the `unpack` module, which is the inverse to `pack`. .Return: _octets_ -.Example: +.Example [source,unlang] ----