Ok Posix expressions are supported here then shouldn't putting parenthases
around the hex characters give me groups %{1}...%{6}?
I do this
DEFAULT Calling-Station-Id =~
"([a-fA-F0-9][a-fA-F0-9])-([a-fA-F0-9][a-fA-F0-9])-([a-fA-F0-9][a-fA-F0-9])-
([a-fA-F0-9][a-fA-F0-9])-([a-fA-F0-9][a-fA-F0-9])-([a-fA-F0-9][a-fA-F0-9])"
User-Name := `%{1}%{2}%{3}%{4}%{5}%{6}`
Instead of getting a mac address with no '-' I get a long weird combination
of
hex and '-'. I mapped out the ${x} groups and they are not what I expect
for example:
11-c0-4f-40-47-b4
becomes groups
%{1} = 11
%{2} = c0-4f
%{3} = 4f-40-47
%{4} = 40-47-b4
%{5} = 47-b4
%{6} = b4
Is my regex wrong or what?
Thanks,
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Alan DeKok
Sent: Monday, October 18, 2004 11:40 AM
To: [EMAIL PROTECTED]
Subject: Re: setting User-Name to 'modified' mac address
Jose Guevarra <[EMAIL PROTECTED]> wrote:
> In my hints file i have
>
> DEFAULT Calling-Station-Id =~
"(\w\w)\-(\w\w)\-(\w\w)\-(\w\w)\-(\w\w)\-(\w\w)"
> User-Name := `%{0}`
>
> This should set the User Name to the hex characters in the mac address
> or 'something' at least
Or something...
And if you're going to use %{0}, you don't need regular expressions.
Just use "%{Calling-Station-Id}"
> However, in debug mode I can see that User-Name is not modified.
>
> In perl i can use the regex below and it seems to work
Perl supports "\w" in regular expressions. Posix expressions (which the
libraries from your system the server uses) do not support "\w".
Alan DeKok.
-
List info/subscribe/unsubscribe? See
http://www.freeradius.org/list/users.html
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html