Creating a timer within a module

Alejandro Pérez Méndez alex at um.es
Mon May 8 20:06:01 CEST 2017


Hello,

I'm trying to extend the functionality of the trust router client which 
is implemented in the trustrouter.c file (within the rlm_realm module) 
by providing basic re-keying capabilities.

The intention is to create some sort of timer that calls the TIDC 
library periodically (e.g. every 10 minutes) and refresh the REALM 
structure (with the TLS keys). So far, this only happens when there is 
traffic associated to that REALM once they keys have expired. Now, for 
that periodical call, I need to create some sort of timer that calls me 
back when the time has expired and let me invoke the TIDC library to 
update the realm.

Since I don't want re-inventing the wheel here, is there any recommended 
way of doing so? I could create a thread, but since you're using some 
sort of thread pool, I don't want to do anything out of control here 
which can lead to race conditions while writing to the realm list.

Thanks,
Alejandro


More information about the Freeradius-Devel mailing list