AVPair extraction

Arran Cudbard-Bell a.cudbardb at freeradius.org
Mon Oct 19 23:41:25 CEST 2015


> On 19 Oct 2015, at 17:31, Alan Batie <alan at peak.org> wrote:
> 
> I need to get data out of the Cisco-AVPair attributes; based on
> 
> http://lists.freeradius.org/pipermail/freeradius-users/2014-May/072096.html
> 
> I'm trying this:
> 

# make cisco attributes accessible
foreach Cisco-AVPair {

if ("%{Foreach-Variable-0}" =~ /^client-mac-address=(.+)/ ) {
	update control {
		client-mac-address = "%{1}"
	}
}
elsif ("%{Foreach-Variable-0}" =~ /^connect-progress=(.+)/ ) {
	update control {
		connect-progress = "%{1}"
	}
}
elsif ("%{Foreach-Variable-0}" =~ /^disc-cause-ext=(.+)/ ) {
	update control {
		disc-cause-ext = "%{1}"
	}
}
elsif ("%{Foreach-Variable-0}" =~ /^nas-rx-speed=(.+)/ ) {
	update control {
		nas-rx-speed = "%{1}"
	}
}
elsif ("%{Foreach-Variable-0}" =~ /^nas-tx-speed=(.+)/ ) {
	update control {
		nas-tx-speed = "%{1}"
	}
}




}

Note the new lines :)

-Arran

Arran Cudbard-Bell <a.cudbardb at freeradius.org>
FreeRADIUS development team

FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 872 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20151019/da2519e7/attachment-0001.sig>


More information about the Freeradius-Users mailing list