foreach attribute array

Arran Cudbard-Bell a.cudbardb at googlemail.com
Sat May 8 00:41:00 CEST 2010


On May 7, 2010, at 3:20 PM, Aaron Paetznick wrote:

> Aw.  Thanks anyways though.  I guess I'll just add a few more 'or's.
> 

Easiest way to do what you're doing is to implode all the variable instances. I don't think the regex engine stops matching on new lines, but I could be wrong.

if("%{Cisco-AVPair[*]}" =~ /client-mac-address=([0-9a-f]{2})[-:]?([0-9a-f]{2})[-:]?([0-9a-f]{2})[-:]?([0-9a-f]{2})[-:]?([0-9a-f]{2})[-:]?([0-9a-f]{2}))/i){
	update request {
		Client-MAC-Address := "%{1}%{2}%{3}%{4}%{5}%{6}"
	}
}

-Arran

> 
> --Aaron
> 
> 
> 
> On 05/07/2010 04:26 PM, Arran Cudbard-Bell wrote:
>>> 
>>> 
>>> Is there a way to do a each, while, for, or foreach on an attribute array?
>> 
>> Not in unlang no, there are no looping structures of any kind.
>> 
>> -Arran
>> 
>> 
>> -
>> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html





More information about the Freeradius-Users mailing list