regexp in inner-tunnel possible?
Hello, we currently have the following setting in inner-tunnel, to perform a check on the radius server sending us the authentication request: authorize { preprocess rewrite.calling_station_id if ("%{clients:shortname}" == "internal_radius_1") { ok update control { Auth-Type := Accept } } elsif (...... We'd like to extend the check to internal_radius_1 AND internal_radius_2. Does inner-data support regexp to do that, maybe using something like the following expression? if ("%{clients:shortname}" ~ "internal_radius_(.*)") { Thank you, Stefano
We'd like to extend the check to internal_radius_1 AND internal_radius_2. Does inner-data support regexp to do that, maybe using something like the following expression? if ("%{clients:shortname}" ~ "internal_radius_(.*)") {
Ciao Stefano, Yes it is possible to do that. You should use: if ("%{clients:shortname}" =~ "/internal_radius_(.*)/") { If you want to check for a regex that does *not* match, use !~ instead. ;-) Stefan Paetow Moonshot Industry & Research Liaison Coordinator t: +44 (0)1235 822 125 gpg: 0x3FCE5142 xmpp: stefanp@jabber.dev.ja.net skype: stefan.paetow.janet jisc.ac.uk Jisc is a registered charity (number 1149740) and a company limited by guarantee which is registered in England under Company No. 5747339, VAT No. GB 197 0632 86. Jisc¹s registered office is: One Castlepark, Tower Hill, Bristol, BS2 0JA. T 0203 697 5800. Jisc Collections and Janet Ltd. is a wholly owned Jisc subsidiary and a company limited by guarantee which is registered in England under Company No. number 2881024, VAT No. GB 197 0632 86. The registered office is: Lumen House, Library Avenue, Harwell, Didcot, Oxfordshire, OX11 0SG. T 01235 822200.
On Jun 3, 2015, at 7:48 AM, Stefano Zanmarchi <zanmarchi@gmail.com> wrote:
We'd like to extend the check to internal_radius_1 AND internal_radius_2. Does inner-data support regexp to do that, maybe using something like the following expression? if ("%{clients:shortname}" ~ "internal_radius_(.*)") {
See "man unlang". The regex operator is documented. Alan DeKok.
participants (3)
-
Alan DeKok -
Stefan Paetow -
Stefano Zanmarchi