Acct-Status-Type block

Alan DeKok aland at deployingradius.com
Thu Feb 1 08:32:56 CET 2007


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



More information about the Freeradius-Devel mailing list