&Tmp-String-0 = "c"
}
-reply += {
+&reply += {
&Reply-Message = "%(concat:%{control.Tmp-String-0[*]} ', ')"
&Reply-Message = "%(concat:%{control.Tmp-String-0[*]} ,)"
}
[source,unlang]
----
-update {
- &control.Tmp-String-0 := "This is a string"
- &control.Tmp-String-0 += "This is another one"
-}
-
-update reply {
- &Reply-Message := "Serialize output: %(pairs:&control.[*])"
-}
+&control.Tmp-String-0 := { "This is a string", "This is another one" }
+&reply.Reply-Message := "Serialize output: %(pairs:&control.[*])"
----
.Output
[source,unlang]
----
-update reply {
- &Reply-Message := "The random string output is %{randstr:aaaaaaaa}"
-}
+&reply.Reply-Message := "The random string output is %{randstr:aaaaaaaa}"
----
.Output
[source,unlang]
----
-update control {
- &Tmp-String-0 := "Caipirinha"
-}
-update reply {
- &Reply-Message := "The length of %{control.Tmp-String-0} is %{strlen:&control.Tmp-String-0}"
-}
+&control.Tmp-String-0 := "Caipirinha"
+&reply.Reply-Message := "The length of %{control.Tmp-String-0} is %{strlen:&control.Tmp-String-0}"
----
.Output
[source,unlang]
----
-update control {
- &Tmp-String-0 := "CAIPIRINHA"
-}
-update reply {
- &Reply-Message := "tolower of %{control.Tmp-String-0} is %{tolower:%{control.Tmp-String-0}}"
-}
+&control.Tmp-String-0 := "CAIPIRINHA"
+&reply.Reply-Message := "tolower of %{control.Tmp-String-0} is %{tolower:%{control.Tmp-String-0}}"
----
.Output
[source,unlang]
----
-update control {
- &Tmp-String-0 := "caipirinha"
-}
-update reply {
- &Reply-Message := "toupper of %{control.Tmp-String-0} is %{toupper:%{control.Tmp-String-0}}"
-}
+&control.Tmp-String-0 := "caipirinha"
+&reply.Reply-Message := "toupper of %{control.Tmp-String-0} is %{toupper:%{control.Tmp-String-0}}"
----
.Output
[source,unlang]
----
-update control {
- &Tmp-String-0 := "Caipirinha"
-}
-update reply {
- &Reply-Message := "The base64 of %{control.Tmp-String-0} is %(base64.encode:%{control.Tmp-String-0})"
-}
+&control.Tmp-String-0 := "Caipirinha"
+&reply.Reply-Message := "The base64 of %{control.Tmp-String-0} is %(base64.encode:%{control.Tmp-String-0})"
----
.Output
[source,unlang]
----
-update control {
- &Tmp-String-0 := "Q2FpcGlyaW5oYQ=="
-}
-update reply {
- &Reply-Message := "The base64.decode of %{control.Tmp-String-0} is %(base64.decode:%{control.Tmp-String-0})"
-}
+&control.Tmp-String-0 := "Q2FpcGlyaW5oYQ=="
+&reply.Reply-Message := "The base64.decode of %{control.Tmp-String-0} is %(base64.decode:%{control.Tmp-String-0})"
----
.Output
[source,unlang]
----
-update control {
- &Tmp-String-0 := "10"
-}
-update reply {
- &Reply-Message := "The %{control.Tmp-String-0} in binary is %{bin:%{control.Tmp-String-0}}"
-}
+&control.Tmp-String-0 := "10"
+&reply.Reply-Message := "The %{control.Tmp-String-0} in binary is %{bin:%{control.Tmp-String-0}}"
----
.Output
[source,unlang]
----
-update control {
- &Tmp-String-0 := "12345"
-}
-update reply {
- &Reply-Message := "The value of %{control.Tmp-String-0} in hex is %{hex:%{control.Tmp-String-0}}"
-}
+&control.Tmp-String-0 := "12345"
+&reply.Reply-Message := "The value of %{control.Tmp-String-0} in hex is %{hex:%{control.Tmp-String-0}}"
----
.Output
[source,unlang]
----
-update {
- &control.Tmp-String-0 := "http://example.org/"
-}
-update reply {
- &Reply-Message += "The urlquote of %{control.Tmp-String-0} is %{urlquote:%{control.Tmp-String-0}}"
+&control.Tmp-String-0 := "http://example.org/"
+&reply += {
+ &Reply-Message = "The urlquote of %{control.Tmp-String-0} is %{urlquote:%{control.Tmp-String-0}}"
}
----
[source,unlang]
----
-update {
- &control.Tmp-String-0 := "http%%3A%%2F%%2Fexample.org%%2F" # Attention for the double %.
-}
-update reply {
- &Reply-Message += "The urlunquote of %{control.Tmp-String-0} is %{urlunquote:%{control.Tmp-String-0}}"
+&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}}"
}
----
[source,unlang]
----
-update {
- &control.Tmp-String-0 := "mykey"
- &control.Tmp-String-1 := "Caipirinha"
-}
-update {
- &control.Tmp-Octets-0 := "%(hmacmd5:%{control.Tmp-String-0} %{control.Tmp-String-1})"
-}
+&control.Tmp-String-0 := "mykey"
+&control.Tmp-String-1 := "Caipirinha"
+&reply.control.Tmp-Octets-0 := "%(hmacmd5:%{control.Tmp-String-0} %{control.Tmp-String-1})"
-update reply {
- &Reply-Message := "The HMAC-MD5 of %{control.Tmp-String-1} in octets is %{control.Tmp-Octets-0}"
- &Reply-Message += "The HMAC-MD5 of %{control.Tmp-String-1} in hex is %{hex:control.Tmp-Octets-0}"
+&reply += {
+ &Reply-Message = "The HMAC-MD5 of %{control.Tmp-String-1} in octets is %{control.Tmp-Octets-0}"
+ &Reply-Message = "The HMAC-MD5 of %{control.Tmp-String-1} in hex is %{hex:control.Tmp-Octets-0}"
}
----
[source,unlang]
----
-update {
- &control.Tmp-String-0 := "mykey"
- &control.Tmp-String-1 := "Caipirinha"
-}
-update {
- &control.Tmp-Octets-0 := "%(hmacsha1:%{control.Tmp-String-0} %{control.Tmp-String-1})"
-}
+&control.Tmp-String-0 := "mykey"
+&control.Tmp-String-1 := "Caipirinha"
+&control.Tmp-Octets-0 := "%(hmacsha1:%{control.Tmp-String-0} %{control.Tmp-String-1})"
-update reply {
- &Reply-Message := "The HMAC-SHA1 of %{control.Tmp-String-1} in octets is %{control.Tmp-Octets-0}"
- &Reply-Message += "The HMAC-SHA1 of %{control.Tmp-String-1} in hex is %{hex:control.Tmp-Octets-0}"
+&reply += {
+ &Reply-Message = "The HMAC-SHA1 of %{control.Tmp-String-1} in octets is %{control.Tmp-Octets-0}"
+ &Reply-Message = "The HMAC-SHA1 of %{control.Tmp-String-1} in hex is %{hex:control.Tmp-Octets-0}"
}
----
[source,unlang]
----
-update control {
- &Tmp-String-0 := "Caipirinha"
-}
-update 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}}}"
+&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}}}"
}
----
[source,unlang]
----
-update {
- &control.Tmp-String-0 := "Caipirinha"
-}
-update 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}}}"
+&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}}}"
}
----
[source,unlang]
----
if (&User-Name == "bob") {
- update request {
- &Tmp-String-0 := "&User-Name"
- }
+ &request.Tmp-String-0 := "&User-Name"
} else {
- update request {
- &Tmp-String-0 := "not bob!"
- }
-}
-
-update reply {
- &Reply-Message := "%{eval:&Tmp-String-0}"
+ &request.Tmp-String-0 := "not bob!"
}
+&reply.Reply-Message := "%{eval:&request.Tmp-String-0}"
----
.Output when `&User-Name == bob`
[source,unlang]
----
-update reply
- &Tmp-String-0 := "%{expr: 1 + 2}"
- }
-}
-
+&reply.Tmp-String-0 := "%{expr:1 + 2}"
----
.Output
[source,unlang]
----
-update reply {
- &Reply-Message := "You should wait for %(nexttime:1h)s"
-}
+&reply.Reply-Message := "You should wait for %(nexttime:1h)s"
----
.Output
[source,unlang]
----
-update reply {
- &Class := "%{pack:%{reply.Framed-IP-Address}%{NAS-IP-Address}}"
-}
+&reply.Class := "%{pack:%{reply.Framed-IP-Address}%{NAS-IP-Address}}"
----
.Output
[source,unlang]
----
-update control {
- &Tmp-String-0 := "user@example.com"
-}
+&control.Tmp-String-0 := "user@example.com"
if (&control.Tmp-String-0 =~ /^(?<login>(.*))@(?<domain>(.*))$/) {
- update reply {
- &Reply-Message := "The %{control.Tmp-String-0} { login=%{regex:login}, domain=%{regex:domain} }"
- }
+ &reply.Reply-Message := "The %{control.Tmp-String-0} { login=%{regex:login}, domain=%{regex:domain} }"
}
----
[source,unlang]
----
-update control {
- &Tmp-String-0 := "Caipirinha is a light and refreshing drink!"
-}
-update reply {
- &Reply-Message := "%(sub:%{control.Tmp-String-0} / / ,)"
-}
+&control.Tmp-String-0 := "Caipirinha is a light and refreshing drink!"
+&reply.Reply-Message := "%(sub:%{control.Tmp-String-0} / / ,)"
----
.Output