Woops - I should have held my fire a bit, I see the answer now. Do you just add your module to the accounting block in radiusd.conf? My next question is can I use an EAP sub-module here? What I have in mind for radiusd.conf is this:
accounting {
acct_unique
# detail
eap_sim # my new eap type
# counter
unix # wtmp file
radutmp
# sradutmp
}
I suspect this won't work, and probably should not be made to work. I notice that the EAP_TYPE blocks in rlm_eap_*.c dont have accounting function pointers. With that, maybe I need to use "eap" in the accounting block, and have an eap_accounting() function to handle my accounting behavior. Or, even though the client was authenticated with EAP, accounting really doesnt involve EAP, so maybe I should define a new RLM module for my new behavior? I also need to add a new function in preaccounting to grab some data and stick it in the accounting record before it's recorded. What do you think?
Thanks,
Dave
Dave Mason wrote:
Hi Alan,--
Those examples should do the trick, except I have one follow-up question. Accounting messages come through after a client is authenticated. Since the EAP handler will be gone by then, how does freeradius know to send Accounting-Request messages to rlm_eap (assuming I add an accounting handler there)? Or does it do something else? The Accounting-Request will have a Class or Vendor-Specific attribute, but probably not EAP, so I'm still not sure where to put my handler.
Regards,
Dave
Alan DeKok wrote:
Dave Mason <[EMAIL PROTECTED]> wrote:
1) As I mentioned in a previous question, I'm writing a new EAP type. To support the accounting procedure we want to use, I may need to return Access-Accept with a Class or Vendor-Specific attribute. Could you advise me how to do this from with rlm_eap framework?
Look at src/modules/rlm_example/rlm_example.c2) My second question concerns how to process the incoming accounting data from the client. I have not studied accounting as much as authentication, so I'm a little rusty. From radiusd.conf it appears that accounting is an RLM module, but I don't see an rlm_acct in the modules directory. I looked through src/main/acct.c and found the rad_accounting() function that looks to be where everything happens, along with the stuff in modules.c. When accounting data comes in (including Class or Vendor-Specific attributes) I'll need to parse it and send it to a backend system, but I'm not sure where to put that code.
Huh? You don't have to parse anything, that's the point of the module system. Look at the 'accounting' section for modules which do accounting. Then look in those modules, and read their accounting routines. Alan DeKok.
--------------------------------------------------------------------------------
Dave Mason (817)481-4412 x139 voice, (817)481-4461 fax, [EMAIL PROTECTED]
Transat Technologies 180 State St, Suite 240, Southlake, TX 76092
Integrating 3GSM and WLAN http://www.transat-tech.com
--------------------------------------------------------------------------------
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
