The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Scheduler communication. More...
#include <freeradius-devel/io/channel.h>
#include <freeradius-devel/io/network.h>
#include <freeradius-devel/io/worker.h>
#include <freeradius-devel/util/log.h>
Go to the source code of this file.
Data Structures | |
struct | fr_schedule_config_t |
Typedefs | |
typedef struct fr_schedule_s | fr_schedule_t |
typedef void(* | fr_schedule_thread_detach_t) (void *uctx) |
Explicitly free resources allocated by fr_schedule_thread_instantiate_t. More... | |
typedef int(* | fr_schedule_thread_instantiate_t) (TALLOC_CTX *ctx, fr_event_list_t *el, void *uctx) |
Setup a new thread. More... | |
Functions | |
fr_schedule_t * | fr_schedule_create (TALLOC_CTX *ctx, fr_event_list_t *el, fr_log_t *log, fr_log_lvl_t lvl, fr_schedule_thread_instantiate_t worker_thread_instantiate, fr_schedule_thread_detach_t worked_thread_detach, fr_schedule_config_t *config)) |
Create a scheduler and spawn the child threads. More... | |
int | fr_schedule_destroy (fr_schedule_t **sc) |
Destroy a scheduler, and tell its child threads to exit. More... | |
fr_network_t * | fr_schedule_directory_add (fr_schedule_t *sc, fr_listen_t *li) |
Add a directory NOTE_EXTEND to a scheduler. More... | |
fr_network_t * | fr_schedule_listen_add (fr_schedule_t *sc, fr_listen_t *li) |
Add a fr_listen_t to a scheduler. More... | |
int | fr_schedule_pthread_create (pthread_t *thread, void *(*func)(void *), void *arg) |
Creates a new thread using our standard set of options. More... | |
int | fr_schedule_worker_id (void) |
Return the worker id for the current thread. More... | |
Scheduler communication.
Definition in file schedule.h.
struct fr_schedule_config_t |
Definition at line 63 of file schedule.h.
Data Fields | ||
---|---|---|
uint32_t | max_networks | number of network threads |
uint32_t | max_workers | number of network threads |
fr_network_config_t | network | configuration for each network; |
fr_time_delta_t | stats_interval | print channel statistics |
fr_worker_config_t | worker | configuration for each worker |
typedef struct fr_schedule_s fr_schedule_t |
Definition at line 1 of file schedule.h.
typedef void(* fr_schedule_thread_detach_t) (void *uctx) |
Explicitly free resources allocated by fr_schedule_thread_instantiate_t.
[in] | uctx | User data passed to callback. |
Definition at line 61 of file schedule.h.
typedef int(* fr_schedule_thread_instantiate_t) (TALLOC_CTX *ctx, fr_event_list_t *el, void *uctx) |
Setup a new thread.
[in] | ctx | to allocate any thread specific memory in. |
[in] | el | Event list used by the thread. |
[in] | uctx | User data passed to callback. |
Definition at line 55 of file schedule.h.
fr_schedule_t* fr_schedule_create | ( | TALLOC_CTX * | ctx, |
fr_event_list_t * | el, | ||
fr_log_t * | logger, | ||
fr_log_lvl_t | lvl, | ||
fr_schedule_thread_instantiate_t | worker_thread_instantiate, | ||
fr_schedule_thread_detach_t | worker_thread_detach, | ||
fr_schedule_config_t * | config | ||
) |
Create a scheduler and spawn the child threads.
[in] | ctx | talloc context. |
[in] | el | event list, only for single-threaded mode. |
[in] | logger | destination for all logging messages. |
[in] | lvl | log level. |
[in] | worker_thread_instantiate | callback for new worker threads. |
[in] | worker_thread_detach | callback to destroy resources allocated by worker_thread_instantiate. |
[in] | config | configuration for the scheduler |
Definition at line 463 of file schedule.c.
int fr_schedule_destroy | ( | fr_schedule_t ** | sc_to_free | ) |
Destroy a scheduler, and tell its child threads to exit.
[in] | sc_to_free | the scheduler |
Definition at line 761 of file schedule.c.
fr_network_t* fr_schedule_directory_add | ( | fr_schedule_t * | sc, |
fr_listen_t * | li | ||
) |
Add a directory NOTE_EXTEND to a scheduler.
[in] | sc | the scheduler |
[in] | li | the ctx and callbacks for the transport. |
Definition at line 913 of file schedule.c.
fr_network_t* fr_schedule_listen_add | ( | fr_schedule_t * | sc, |
fr_listen_t * | li | ||
) |
Add a fr_listen_t to a scheduler.
[in] | sc | the scheduler |
[in] | li | the ctx and callbacks for the transport. |
Definition at line 881 of file schedule.c.
int fr_schedule_pthread_create | ( | pthread_t * | thread, |
void *(*)(void *) | func, | ||
void * | arg | ||
) |
Creates a new thread using our standard set of options.
New threads are:
[out] | thread | handled that was created by pthread_create. |
[in] | func | entry point for the thread. |
[in] | arg | Argument to pass to func. |
Definition at line 425 of file schedule.c.
int fr_schedule_worker_id | ( | void | ) |
Return the worker id for the current thread.
Definition at line 157 of file schedule.c.