reference packet code in unlang?
Arran Cudbard-Bell
A.Cudbard-Bell at sussex.ac.uk
Tue Apr 22 15:26:12 CEST 2008
Stefan Winter wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> |> if (Acct-Status-Type == "Accounting-Off" && !(Acct-Session-Id =~
> |> /restena.*/)) update control {
> |> ~ Proxy-To-Realm := testrealm.lu
> |> ~ }
>
> You mean, replace " by / ? That didn't do the trick...
>
> if (Acct-Status-Type == "Accounting-Off" && !(Acct-Session-Id =~
> /restena.*/)) update control {
> ~ Proxy-To-Realm := testrealm.lu
> ~ }
>
> resulted in
>
> Parse error in condition at: Acct-Status-Type == "Accounting-Off" &&
> !(Acct-Session-Id =~ /restena.*/)) update control {
>
Ok I haven't been keeping up with the syntaxical developments... so some
of this may be slightly redundant.
if (("%{Acct-Status-Type}" == 'Accounting-Off') &&
!("%{Acct-Session-Id}" =~
/restena.*/)) {
update control {
Proxy-To-Realm := 'testrealm.lu'
}
}
That should work no matter how stupid the parser is...
* Regular expressions have always been <attribute> ~= /<expr>/[<mod>]
* Attribute expansion always used to be "%{[<list>:]<attribute>}" but I
understand Alan changed that, though I thought he only deprecated the
double quotes part not the percent curly braces wrapper... but don't
take my word for it.
* Strings you don't want to be expanded should be encapsulated in single
quotes not double.
* You can't do <condition><operation> on the same line
* Sub conditions should be encapsulated in parenthesis
Thanks,
Arran
> Greetings,
>
> Stefan
> - -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.4-svn0 (GNU/Linux)
> Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org
>
> iD8DBQFIDeLG+jm90f8eFWYRAic9AJwIuRTycJLXPhbmsd5KtgFkkHhU6wCcCzy6
> dL/v1IugqQ/c3cWMi4C/ESs=
> =5y3Y
> -----END PGP SIGNATURE-----
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html
--
Arran Cudbard-Bell (A.Cudbard-Bell at sussex.ac.uk)
Authentication, Authorisation and Accounting Officer
Infrastructure Services | ENG1 E1-1-08
University Of Sussex, Brighton
EXT:01273 873900 | INT: 3900
More information about the Freeradius-Users
mailing list