Hi,

Not sure about it but I think you might be able to use regex to do that.
It may be something like:

if("%{NAS-Port-Id}" =~ / \b[1-4][0-9]{3}/) { #this to extract the vlan

        switch "%{1}" { #this to refer to the matched vlan tag substring

                case 1000 {
                        ....
                }

                case 1001 {
                        ....
                }
                ....
        }
}

But you might need to double check the syntax in man unlang. Hopefully someone will correct me on this.

Regards,
Krzysztof

On 20/03/13 09:57, Łukasz Kopiszka wrote:
Hi,

I'm receiving from SE100:
NAS-Port-Id = "2/2 vlan-id 1001 clips 132019"

How to extract number 1001 which will be used in code:

switch "extracted vlan-id" {
        case 1000 {
                ...
    }
        case 1001 {
                ...
    }
        case 1002 {
                ...
    }
...
}





Airspeed Telecom
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to