]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove more uses of 'Tmp-*'
authorAlan T. DeKok <aland@freeradius.org>
Mon, 19 Jan 2026 15:50:18 +0000 (10:50 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 19 Jan 2026 15:56:39 +0000 (10:56 -0500)
doc/antora/modules/reference/pages/type/cast.adoc
doc/antora/modules/reference/pages/unlang/foreach.adoc
doc/antora/modules/reference/pages/unlang/local.adoc
doc/antora/modules/reference/pages/xlat/misc/misc.adoc
doc/antora/modules/reference/pages/xlat/pairs/print.adoc
doc/antora/modules/reference/pages/xlat/str/concat.adoc
doc/antora/modules/reference/pages/xlat/str/split.adoc

index 02aead9d0eda78d022d87df16f6f869f99f9a734..aab908a17c43df61e938e443f4085f1f55a6e57e 100644 (file)
@@ -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
index fa3a73eecde172079f2497c2c33b29ae8b9f2ce6..67c0e61342f2758cb677c6aeb3f7e8c3443d3c0a 100644 (file)
@@ -27,7 +27,7 @@ The `<key-type>` is the data type for the key or index variable.  The data type
 
 <key-name>::
 
-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.
index a45acdf322f47424dc9ea17a6acb2bee6c42fad2..e47851a7631583568547dd78a428cf12e5564839 100644 (file)
@@ -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}"
 }
index 8762a7847070e4937f5db833fa8bfc9ab162185a..bcdd2450da83b4d5ae63a50d37dd8fcd77837c5e 100644 (file)
@@ -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`
index 93c218843089f04dd3097114e270c6d2c1164c15..1c9cec2179566190b43cbdaa789508f5a47dab4b 100644 (file)
@@ -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.
index 563201b5ec375a2acd75e2ad41e8b9cdbbe4f901..257634c0f789c33dba855515c4531e3e46406819 100644 (file)
@@ -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.
index fdb02f9f2748b189586b80f759197259e78943a0..0a9b945c050a3480011628d145f7fcbf08672f89 100644 (file)
@@ -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