From: Alan T. DeKok Date: Mon, 19 Jan 2026 15:50:18 +0000 (-0500) Subject: remove more uses of 'Tmp-*' X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8548b0c0b7a2b82327601a1bcbf85fc2e8a03b6c;p=thirdparty%2Ffreeradius-server.git remove more uses of 'Tmp-*' --- diff --git a/doc/antora/modules/reference/pages/type/cast.adoc b/doc/antora/modules/reference/pages/type/cast.adoc index 02aead9d0ed..aab908a17c4 100644 --- a/doc/antora/modules/reference/pages/type/cast.adoc +++ b/doc/antora/modules/reference/pages/type/cast.adoc @@ -142,12 +142,12 @@ reply.Reply-Message := control.Reply-Message[*] The following example will take an input string `"192.168.0.1"`, split it on the `'.'` character, and then assign it to another attribute. -The result will be four copies of the `Tmp-Integer-0` attribute, which +The result will be four copies of the `NAS-Port` attribute, which each carry one octet of the IP address. .Example Creating multiple Attributes ---- -Tmp-Integer-0 := %str.split("192.168.0.1", '.') +NAS-Port := %str.split("192.168.0.1", '.') ---- If you need to cast an entire list to a value, then the value being diff --git a/doc/antora/modules/reference/pages/unlang/foreach.adoc b/doc/antora/modules/reference/pages/unlang/foreach.adoc index fa3a73eecde..67c0e61342f 100644 --- a/doc/antora/modules/reference/pages/unlang/foreach.adoc +++ b/doc/antora/modules/reference/pages/unlang/foreach.adoc @@ -27,7 +27,7 @@ The `` is the data type for the key or index variable. The data type :: -The local variable where the key refereence is placed. +The local variable where the key reference is placed. For numerical data types, the key value starts off at zero (0), and increases by one every round through the loop. For `string` data @@ -100,19 +100,19 @@ It is not possible to delete the attributes being looped over. .Example of modifying values [source,unlang] ---- -Tmp-Integer-0 := { 1, 3, 5, 11 } +NAS-Port := { 1, 3, 5, 11 } -foreach self (Tmp-Integer-0) { - self += 19 +foreach item (NAS-Port) { + item += 19 } ---- -Once the loop has finished , the `Tmp-Integer-0` attribute will have +Once the loop has finished , the `NAS-Port` attribute will have the following set of values. [source,unlang] ---- -Tmp-Integer-0 := { 20, 22, 24, 30 } +NAS-Port := { 20, 22, 24, 30 } ---- .Pseudocode for variable modification @@ -145,12 +145,12 @@ the value at the beginning of each loop iteration. [source,unlang] ---- string total -Tmp-Integer-0 := { 1, 3, 5, 11 } +NAS-Port := { 1, 3, 5, 11 } -foreach string ref, uint32 self (Tmp-Integer-0) { +foreach string ref, uint32 item (NAS-Port) { total += ref total += " = " - total += (string) self + total += (string) item total += ", " } ---- @@ -158,16 +158,16 @@ foreach string ref, uint32 self (Tmp-Integer-0) { When the loop is finished, the `total` variable will have the following value: ---- -"Tmp-Integer-0[0] = 1, "Tmp-Integer-0[1] = 3, "Tmp-Integer-0[2] = 5, "Tmp-Integer-0[3] = 11, " +"NAS-Port[0] = 1, "NAS-Port[1] = 3, "NAS-Port[2] = 5, "NAS-Port[3] = 11, " ---- .Key variable with attribute index [source,unlang] ---- string total -Tmp-Integer-0 := { 1, 3, 5, 11 } +NAS-Port := { 1, 3, 5, 11 } -foreach uint32 index, uint32 self (Tmp-Integer-0) { +foreach uint32 index, uint32 item (NAS-Port) { ... } ---- @@ -235,6 +235,5 @@ foreach thing (TLV-Thing[*]) { This example can read the child attribute `Foo`, but cannot modify it. - -// Copyright (C) 2024 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Copyright (C) 2026 Network RADIUS SAS. Licenced under CC-by-NC 4.0. // This documentation was developed by Network RADIUS SAS. diff --git a/doc/antora/modules/reference/pages/unlang/local.adoc b/doc/antora/modules/reference/pages/unlang/local.adoc index a45acdf322f..e47851a7631 100644 --- a/doc/antora/modules/reference/pages/unlang/local.adoc +++ b/doc/antora/modules/reference/pages/unlang/local.adoc @@ -54,7 +54,7 @@ Local variables _cannot_ be deleted. When the current scope exits, the local va if (User-Name == "bob") { uint32 len - len := %length(%{User-Name}) + len := %length(User-Name) Reply-Message := "Length of %{User-Name} is %{len}" } diff --git a/doc/antora/modules/reference/pages/xlat/misc/misc.adoc b/doc/antora/modules/reference/pages/xlat/misc/misc.adoc index 8762a784707..bcdd2450da8 100644 --- a/doc/antora/modules/reference/pages/xlat/misc/misc.adoc +++ b/doc/antora/modules/reference/pages/xlat/misc/misc.adoc @@ -58,12 +58,12 @@ Evaluates the string as an expansion, and returns the result. The main differen [source,unlang] ---- if (User-Name == "bob") { - request.Tmp-String-0 := "User-Name" + control.Filter-Id := "User-Name" } else { - request.Tmp-String-0 := "not bob!" + control.Filter-Id := "not bob!" } -reply.Reply-Message := "%eval(request.Tmp-String-0}" +reply.Reply-Message := "%eval(control.Filter-Id}" ---- .Output when `User-Name == bob` diff --git a/doc/antora/modules/reference/pages/xlat/pairs/print.adoc b/doc/antora/modules/reference/pages/xlat/pairs/print.adoc index 93c21884308..1c9cec21795 100644 --- a/doc/antora/modules/reference/pages/xlat/pairs/print.adoc +++ b/doc/antora/modules/reference/pages/xlat/pairs/print.adoc @@ -13,7 +13,7 @@ given attribute. e.g. `reply += "User-Name := 'hello'"`. [source,unlang] ---- -control.Tmp-String-0 := { "This is a string", "This is another one" } +control.Filter-Id := { "This is a string", "This is another one" } reply.Reply-Message := "Serialize output: %pairs.print(control.[*])" ---- @@ -21,7 +21,7 @@ reply.Reply-Message := "Serialize output: %pairs.print(control.[*])" .Output ``` -Serialize output: Tmp-String-0 = "\"This is a string\", Tmp-String-0 = \"This is another one\"" +Serialize output: Filter-Id = "\"This is a string\", Filter-Id = \"This is another one\"" ``` // Copyright (C) 2025 Network RADIUS SAS. Licenced under CC-by-NC 4.0. diff --git a/doc/antora/modules/reference/pages/xlat/str/concat.adoc b/doc/antora/modules/reference/pages/xlat/str/concat.adoc index 563201b5ec3..257634c0f78 100644 --- a/doc/antora/modules/reference/pages/xlat/str/concat.adoc +++ b/doc/antora/modules/reference/pages/xlat/str/concat.adoc @@ -13,11 +13,11 @@ expanded string. If you need to concatenate strings together in a policy, just [source,unlang] ---- -control.Tmp-String-0 := { "aaa", "bb", "c" } +Filter-Id := { "aaa", "bb", "c" } reply += { - Reply-Message = %str.concat(%{control.Tmp-String-0[*]}, ', ') - Reply-Message = %str.concat(%{control.Tmp-String-0[*]}, ',') + Reply-Message = %str.concat(%{Filter-Id[*]}, ', ') + Reply-Message = %str.concat(%{Filter-Id[*]}, ',') } ---- @@ -28,5 +28,5 @@ aaa, bb, c aaa,bb,c ``` -// Copyright (C) 2025 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Copyright (C) 2026 Network RADIUS SAS. Licenced under CC-by-NC 4.0. // This documentation was developed by Network RADIUS SAS. diff --git a/doc/antora/modules/reference/pages/xlat/str/split.adoc b/doc/antora/modules/reference/pages/xlat/str/split.adoc index fdb02f9f274..0a9b945c050 100644 --- a/doc/antora/modules/reference/pages/xlat/str/split.adoc +++ b/doc/antora/modules/reference/pages/xlat/str/split.adoc @@ -10,11 +10,13 @@ This expansion is the inverse of xref:xlat/str/concat.adoc[str.concat]. [source,unlang] ---- +string name + User-Name := "bob.toba@domain.com" -control.Tmp-String-1 := %str.split(User-Name, '@') +name := %str.split(User-Name, '@') -reply.Reply-Message := "Welcome %{control.Tmp-String-1[0]}" +reply.Reply-Message := "Welcome %{name}" ---- .Output