regexp in attr-rewrite confuses me!

Tariq Rashid tariq.rashid at uk.easynet.net
Fri Jun 24 15:51:30 CEST 2005


in addition, the following suggests an unsual regex process...

attr_rewrite attr_rewrite_post-proxy {
                attribute = Framed-Route
                searchin = proxy_reply
                searchfor = "([0-9.]+) ([0-9.]+) ([0-9]+)(.*)"
                replacewith = "[%{1}] [%{2}] [%{3}]"
                new_attribute = no
                ignore_case = no
                max_matches = 1
                append = no
        }

gives me the following unusual output:

modcall[post-proxy]: module "attr_filter_post-proxy" returns updated for
request 0
radius_xlat:  '([0-9.]+) ([0-9.]+) ([0-9]+)(.*)'
radius_xlat:  '[29 83.67.214.16] [83.67.214.161 1] [1]'
rlm_attr_rewrite: Changed value for attribute Framed-Route from
'83.67.67.192/29 83.67.214.161 1' to '83.67.67.192/[29 83.67.214.16]
[83.67.214.161 1] [1]'

that is:
	Framed-Route = "83.67.67.192/[29 83.67.214.16] [83.67.214.161 1]
[1]"

so spaces appear in the matched items []. as before there is too much in %2
and £3 is puzzling. i'm surprised by the 83.67.67.192/ in the output when
its not in the output template.

i'm obviouslty confused so any light shed on this matter would be great!

tariq




More information about the Freeradius-Users mailing list