It just occurred to me that it would be pretty cool to be able to do: accounting { Acct-Status-Type Stop { ## Log stop packets to disk stop_log } } In the same manner as: post-auth { Post-Auth-Type REJECT { ## Log authentication rejects to disk reply_log } } Is there any way to do this at present (short of writing a custom module)? Cheers -- Peter Nixon http://www.peternixon.net/ PGP Key: http://www.peternixon.net/public.asc
Peter Nixon wrote:
It just occurred to me that it would be pretty cool to be able to do:
accounting { Acct-Status-Type Stop { ## Log stop packets to disk stop_log } }
Yup.
Is there any way to do this at present (short of writing a custom module)?
Don't write a custom module, hack src/main/mod*.c. My main difficulty with that is I'd like to find a way to do it more extensibly, without getting insanely complicated. Maybe leverage the new "if" hack? if "%{Acct-Status-Type} == Stop" { ... } It's horrid syntax, but it might work. It also means that much of rlm_policy would be subsumed into the server core, which may not be a bad thing. With a bit of work on the parser, we could have: if (%{Acct-Status-Type} == "Stop") { ... } which is a bit more sane. Hacking the parser isn't hard. Adding all of the code to expand the strings and do int/ipaddr/string comparison is a bit more work. Alan DeKok. -- http://deployingradius.com - The web site of the book http://deployingradius.com/blog/ - The blog
On Thu 01 Feb 2007 09:32, Alan DeKok wrote:
Peter Nixon wrote:
It just occurred to me that it would be pretty cool to be able to do:
accounting { Acct-Status-Type Stop { ## Log stop packets to disk stop_log } }
Yup.
Is there any way to do this at present (short of writing a custom module)?
Don't write a custom module, hack src/main/mod*.c.
Sure. That bit I understood ;-)
My main difficulty with that is I'd like to find a way to do it more extensibly, without getting insanely complicated.
Maybe leverage the new "if" hack?
if "%{Acct-Status-Type} == Stop" { ... }
It's horrid syntax, but it might work. It also means that much of rlm_policy would be subsumed into the server core, which may not be a bad thing.
With a bit of work on the parser, we could have:
if (%{Acct-Status-Type} == "Stop") { ... }
which is a bit more sane.
Definitely...
Hacking the parser isn't hard. Adding all of the code to expand the strings and do int/ipaddr/string comparison is a bit more work.
Yeah. I my opinion it makes sense to have this code in the server core. We came across similar problems when adding configurable logging. It would be nice if attributes in the config file were automatically run through xlat rather than having to do it manually inside each module.. Being able to do these type of "if" comparisons at arbitrary spots inside radiusd.conf could lead to some interesting (insanely complicated) configurations while simplifying the module(s) code somewhat. I am sure it will lead to more support headaches on the mailing list, but it will make practically ANY config possible Cheers -- Peter Nixon http://www.peternixon.net/ PGP Key: http://www.peternixon.net/public.asc
participants (2)
-
Alan DeKok -
Peter Nixon