2 * acct.c Accounting routines.
4 * Version: @(#)acct.c 2.12 07-Aug-1999 miquels@cistron.nl
7 "@(#)acct.c 2.12 Copyright 1999 Cistron Internet Services B.V.";
19 * rad_accounting: call modules.
21 int rad_accounting(REQUEST *request)
26 * FIXME: Prefix= and Suffix= support needs to be added!
28 * We need to get the Prefix= and Suffix= things from
29 * the users file to apply.
30 * In 1.5.4.3, we used presuf_setup() but that is
31 * not possible anymore. Perhaps we need an extra
32 * module entry point for this ?
36 if(!request->proxy) { /* Only need to do this once, before proxying */
37 reply = module_preacct(request);
38 if (reply != RLM_MODULE_OK)
39 return RLM_MODULE_FAIL;
41 /* Maybe one of the preacct modules has decided that a proxy should
42 * be used. If so, get out of here and send the packet. */
43 if(pairfind(request->config_items, PW_PROXY_TO_REALM))
47 reply = RLM_MODULE_OK;
48 if (!request->proxy) {
50 * Keep the radutmp file in sync.
55 * Do accounting and if OK, reply.
57 reply = module_accounting(request);
59 if (reply == RLM_MODULE_OK) {
61 * Now send back an ACK to the NAS.
63 request->reply = build_reply(PW_ACCOUNTING_RESPONSE, request,
65 reply = RLM_MODULE_OK;