FreeRADIUS InkBridge

%length( …​ )

The length function returns the size of the input as an integer. When the input is a string, then the output is identical to the strlen expansion.

When the input is an attribute reference, the output is the size of the attributes data as encoded "on the wire".

Example 1. Determining the length of fixed and variable length attributes
Tmp-String-0 := "Caipirinha"
Framed-IP-Address := 192.0.2.1

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)"
}
Output
The length of Caipirinha is 10
The length of 192.168.0.2 is 4