hints processing for Accounting-On / Off packets?
Phil Mayers
p.mayers at imperial.ac.uk
Mon Feb 13 11:25:16 CET 2006
Stefan Winter wrote:
> Hello,
>
> on my system I noticed that Accounting-On/Off packets don't seem to get the
> same treatment as other accoutning packets. The situation is as follows:
>
<snip>
>
> Now I wonder why these packets aren't tagged by hints, even though they have
> the same Client-IP-Address as normal packets and normal packets _do_ get
> tagged.
> Anyone a clue?
It seems you're right. The 1.1.0 source has in rlm_preprocess:
static int hints_setup(PAIR_LIST *hints, REQUEST *request)
{
char *name;
VALUE_PAIR *add;
VALUE_PAIR *tmp;
PAIR_LIST *i;
VALUE_PAIR *request_pairs;
request_pairs = request->packet->vps;
if (hints == NULL || request_pairs == NULL)
return RLM_MODULE_NOOP;
i.e. if there's no username, which there isn't in an Acct-On/Off, skip
processing. This makes sense of course, because the "hints" file refers
to hint strings in the USERNAME, such as "username.ppp" meaning to start
PPP.
Sadly you can't use an ordinary "users" file, because you want to add
the RESTENA-Service-Type to the INPUT AVPs. You could add it to the
config AVPs then do this:
detailfile = path/%{config:RESTENA-Service-Type}-service/detail
...but sadly the "users" file can't add arbitrary things to config
items; just AVPs it "knows" are server AVPs.
You could use a "passwd" module instance like this:
modules {
passwd accttype {
filename = /path/to/file
# lookup on *ed field; ~ed are added to request; unprefixed
# are added to configure; =ed are added to reply
format = "*Client-IP-Address:~RESTENA-Service-Type:Acct-Type"
hashsize = 100
}
}
authorize {
preprocess
accttype
# other stuff
}
>
> Greetings,
>
> Stefan Winter
>
More information about the Freeradius-Users
mailing list