AVPair extraction

Alan Batie alan at peak.org
Tue Oct 20 00:55:06 CEST 2015


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."

accounting {
        # 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}"
                }
            }
        }

 Module: Checking accounting {...} for more modules to load
/etc/raddb/sites-enabled/peak[393]: Failed to find "foreach" in the
"modules" section.
/etc/raddb/sites-enabled/peak[391]: Errors parsing accounting section.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5903 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20151019/279f5408/attachment.bin>


More information about the Freeradius-Users mailing list