Multiple attributes / extraction of a specific value with unlang regex ?
Chaigneau, Nicolas
nicolas.chaigneau at capgemini.com
Mon Feb 17 10:55:31 CET 2014
Hello,
I'm working with FreeRADIUS 3.0.1.
I'm trying to extract a value from an array of attributes, such as :
Cisco-AVPair = "<prefix>=<value>"
There are multiple Cisco-AVPair values in packet, I want to extract <value> from the attribute starting with "<prefix>=".
I read this from unlang man page :
%{Attribute-Name[*]}
Expands to a single string, with the value of each array member separated by a newline.
(note that it seems members are separated by ",", not by a newline)
So I tried the following :
if ("%{Cisco-AVPair[*]}" =~ /circuit-id-tag=([^,]*)/ ) {
update control {
My-Cisco-Circuit-Id := "%{1}"
}
}
This works, but is not good enough because <value> might contain a comma.
Is there a better way to do this with unlang ?
Thanks.
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
More information about the Freeradius-Users
mailing list