====
[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)"
}
----
====
[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
====
[source,unlang]
----
-update reply {
- &Reply-Message := "The random number is %{rand:512}"
-}
+&reply.Reply-Message := "The random number is %{rand:512}"
----
.Output
```
====
-=== %{tag:<attribute ref>}
-
-CAUTION: This expansion is deprecated and will likely be removed.
-
-Returns a list of tags for any attributes found using ``<attribute ref>``.
-
-.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:<data>}
Convert input to a string if (possible). For _octets_ type
[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[*]} ,)"
}
----
[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
[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
[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
.Return: _data_
-.Example:
+.Example
[source,unlang]
----
.Return: _string_
-.Example:
+.Example
With the current time at 16:18, `%(nexttime:1h)` will expand to `2520`.
.Return: _octets_
-.Example:
+.Example
[source,unlang]
----