On Oct 20, 2015, at 2:09 PM, Alan DeKok <aland@deployingradius.com> wrote:
On Oct 19, 2015, at 6:55 PM, Alan Batie <alan@peak.org> wrote:
On 10/19/15 2:41 PM, Arran Cudbard-Bell wrote:
} elsif ("%{Foreach-Variable-0}" =~ /^nas-tx-speed=(.+)/ ) {
Note the new lines :)
Ooook, progress - now I get "Failed to find "foreach" in the "modules" section."
Use v3. "foreach" is a key word in that version.
In v2... write a Perl program to do the re-writing.
Ah, yes, I assumed it was v3 as foreach was being used. In v3.1.x you can also do if (&Cisco-AVPair[*] =~ /^client-mac-address=(.+)/) { update request { Calling-Station-ID := "%{1}" } } or foreach &Stupid-VSA { if ("%{Foreach-variable-0}" =~ /^([^=]+)=(.+)$/) { update { "%{1}" = "%{2}" } } } (if you define VSAs that match the attributes encapsulated in Stupid-VSA) Note: You need to define attributes in the dictionaries before they can be used in the config, so it's best to map the Cisco attributes to RFC attrs that are already defined. Some vendors which only provide a stupid <attr>=<value> VSA, in v3.1.x, you can add real VSAs to those dictionaries and unpack the stupid text attributes into proper VSAs. -Arran