Acct-Status-Type block
Peter Nixon
listuser at peternixon.net
Thu Feb 1 10:02:31 CET 2007
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.freeradius.org/pipermail/freeradius-devel/attachments/20070201/f2b235b5/attachment.pgp>
More information about the Freeradius-Devel
mailing list