![]() |
The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Sending pair lists to and from coordination threads. More...
#include <freeradius-devel/internal/internal.h>#include <freeradius-devel/io/listen.h>#include <freeradius-devel/io/coord_pair.h>#include <freeradius-devel/io/coord_priv.h>#include <freeradius-devel/server/main_config.h>#include <freeradius-devel/unlang/base.h>
Include dependency graph for coord_pair.c:Go to the source code of this file.
Data Structures | |
| struct | fr_coord_packet_ctx_t |
| Packet context used when coordinator messages are processed through an interpreter. More... | |
| struct | fr_coord_pair_s |
Functions | |
| static | _Atomic (uint64_t) |
| Registration of pair list callbacks. | |
| static int | _coord_pair_reg_free (fr_coord_pair_reg_t *to_free) |
| Remove a coord pair registration from the list when it is freed. | |
| static int | _coord_pair_request_deinit (request_t *request, UNUSED void *uctx) |
| static void | _coord_pair_request_detach (request_t *request, void *uctx) |
| Make us responsible for running the request. | |
| static void | _coord_pair_request_done_detached (request_t *request, UNUSED rlm_rcode_t rcode, UNUSED void *uctx) |
| Detached request (i.e. | |
| static void | _coord_pair_request_done_external (UNUSED request_t *request, UNUSED rlm_rcode_t rcode, UNUSED void *uctx) |
| External request is now complete - will never happen with coordinators. | |
| static void | _coord_pair_request_done_internal (request_t *request, UNUSED rlm_rcode_t rcode, void *uctx) |
| Internal request (i.e. | |
| static void | _coord_pair_request_internal_init (request_t *request, void *uctx) |
| static void | _coord_pair_request_prioritise (request_t *request, void *uctx) |
| Update a request's priority. | |
| static void | _coord_pair_request_resume (request_t *request, UNUSED void *uctx) |
| Interpreter is starting to work on request again. | |
| static void | _coord_pair_request_runnable (request_t *request, void *uctx) |
| Request is now runnable. | |
| static bool | _coord_pair_request_scheduled (request_t const *request, UNUSED void *uctx) |
| Check if a request is scheduled. | |
| static void | _coord_pair_request_timeout (UNUSED fr_timer_list_t *tl, UNUSED fr_time_t when, void *uctx) |
| Enforce max_request_time. | |
| static void | _coord_pair_request_yield (request_t *request, UNUSED void *uctx) |
| Interpreter yielded request. | |
| static void | coord_pair_request_bootstrap (fr_coord_pair_t *coord_pair, uint32_t worker_id, fr_dbuff_t *dbuff, fr_time_t now, void *uctx) |
| static void | coord_pair_request_init (fr_event_list_t *el, request_t *request, fr_time_t now, void *packet_ctx) |
| static void | coord_pair_request_name_number (request_t *request) |
| static void | coord_pair_request_time_tracking_end (fr_coord_pair_t *coord_pair, request_t *request, fr_time_t now) |
| End time tracking for a request. | |
| static int | coord_pair_request_time_tracking_start (fr_coord_pair_t *coord_pair, request_t *request, fr_time_t now) |
| Start time tracking for a request, and mark it as runnable. | |
| static int8_t | coord_pair_runnable_cmp (void const *one, void const *two) |
| Compare two requests by priority and sequence. | |
| static void | coord_pair_stop_request (request_t *request) |
| Signal the unlang interpreter that it needs to stop running the request. | |
| static void | coord_run_request (fr_coord_pair_t *coord_pair, fr_time_t start) |
| static fr_coord_pair_t * | fr_coord_pair_create (TALLOC_CTX *ctx, fr_coord_t *coord, fr_event_list_t *el, bool single_thread, void *uctx) |
| Create the coord_pair coord instance data. | |
| void | fr_coord_pair_data_recv (UNUSED fr_coord_t *coord, uint32_t worker_id, fr_dbuff_t *dbuff, fr_time_t now, void *inst, void *uctx) |
| Callback run when a coordinator receives pair list data. | |
| static void | fr_coord_pair_event (UNUSED fr_event_list_t *el, void *uctx) |
| Event callback in multi threaded mode. | |
| fr_coord_cb_inst_t * | fr_coord_pair_inst_create (TALLOC_CTX *ctx, fr_coord_t *coord, fr_event_list_t *el, bool single_thread, void *uctx) |
| Plugin creation called during coordinator creation. | |
| static void | fr_coord_pair_post_event (UNUSED fr_event_list_t *el, UNUSED fr_time_t now, void *uctx) |
| static int | fr_coord_pair_pre_event (UNUSED fr_time_t now, UNUSED fr_time_delta_t wake, void *uctx) |
| uint32_t | fr_coord_pair_reg_cb_id (fr_coord_pair_reg_t *coord_pair_reg) |
| Return the coordinator callback ID associated with a coord_pair_reg_t. | |
| fr_coord_pair_reg_t * | fr_coord_pair_register (TALLOC_CTX *ctx, fr_coord_pair_reg_ctx_t *reg_ctx) |
| Register a set of callbacks for pair list based coordinator messages. | |
| static int | fr_coord_pair_request_timeout_set (fr_coord_pair_t *coord_pair, request_t *request, fr_time_delta_t timeout) |
| Set, or re-set the request timer. | |
| int | fr_coord_to_worker_reply_send (request_t *request, uint32_t worker_id) |
| Send a reply list from a coordinator to a worker. | |
| void | fr_coord_worker_pair_data_recv (fr_coord_worker_t *cw, fr_dbuff_t *dbuff, fr_time_t now, void *uctx) |
| Callback run when a worker receives pair list data. | |
| int | fr_worker_to_coord_pair_send (fr_coord_worker_t *cw, fr_coord_pair_reg_t *coord_pair_reg, fr_pair_list_t *list) |
| Send a pair list from a worker to a coordinator. | |
Variables | |
| static const conf_parser_t | request_reuse_config [] |
| Conf parser to read slab settings from module config. | |
Sending pair lists to and from coordination threads.
Definition in file coord_pair.c.
| struct fr_coord_packet_ctx_t |
Packet context used when coordinator messages are processed through an interpreter.
Allows access to the coordinator structure and arbitrary data throughout the state machine.
Definition at line 77 of file coord_pair.c.
Collaboration diagram for fr_coord_packet_ctx_t:| Data Fields | ||
|---|---|---|
| fr_coord_pair_t * | coord_pair | Coordinator pair this packet is for. |
| void * | uctx | Source specific ctx. |
| struct fr_coord_pair_s |
Definition at line 58 of file coord_pair.c.
Collaboration diagram for fr_coord_pair_s:| Data Fields | ||
|---|---|---|
| fr_coord_t * | coord | Coordinator which this coord pair is attached to. |
| fr_coord_pair_reg_t * | coord_pair_reg | Registration details for this coord pair. |
| fr_event_list_t * | el | Event list for interpreter. |
| unlang_interpret_t * | intp | Interpreter for running requests. |
| uint64_t | num_active | Number of active requests. |
| fr_time_delta_t | predicted | How long we predict a request will take to execute. |
| fr_heap_t * | runnable | Current runnable requests. |
| request_slab_list_t * | slab | slab allocator for request_t |
| fr_timer_list_t * | timeout | Track when requests timeout using a dlist. |
| fr_time_tracking_t | tracking | How much time the coordinator has spent doing things. |
|
static |
Registration of pair list callbacks.
< Entry in list of pair list registrations
< Attribute containing packet type
< Pair list decoding root attribute
< Array of pointers to callbacks
< Largest valid value for packet type
< The coordinator callback ID used for pair list handling
< Maximum time for coordinator request processing.
< Request slab allocation config.
< Virtual server containing coordinator process sections.
Definition at line 34 of file coord_pair.c.
|
static |
Remove a coord pair registration from the list when it is freed.
Definition at line 91 of file coord_pair.c.
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 334 of file coord_pair.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Make us responsible for running the request.
Definition at line 465 of file coord_pair.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Detached request (i.e.
one generated by the interpreter with no parent) is now complete
As the request has no parent, then there's nothing to free it so we have to.
Definition at line 451 of file coord_pair.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
External request is now complete - will never happen with coordinators.
Definition at line 426 of file coord_pair.c.
Here is the caller graph for this function:
|
static |
Internal request (i.e.
one generated by the interpreter) is now complete
Whatever generated the request is now responsible for freeing it.
Definition at line 435 of file coord_pair.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 401 of file coord_pair.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Update a request's priority.
Definition at line 531 of file coord_pair.c.
Here is the call graph for this function:
Here is the caller graph for this function:Interpreter is starting to work on request again.
Definition at line 514 of file coord_pair.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Request is now runnable.
Definition at line 494 of file coord_pair.c.
Here is the call graph for this function:
Here is the caller graph for this function:Check if a request is scheduled.
Definition at line 523 of file coord_pair.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Enforce max_request_time.
| [in] | tl | the coordinators's timer list. |
| [in] | when | the current time |
| [in] | uctx | the request_t timing out. |
Definition at line 246 of file coord_pair.c.
Here is the call graph for this function:
Here is the caller graph for this function:Interpreter yielded request.
Definition at line 505 of file coord_pair.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 339 of file coord_pair.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Definition at line 313 of file coord_pair.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Definition at line 327 of file coord_pair.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
End time tracking for a request.
Definition at line 301 of file coord_pair.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Start time tracking for a request, and mark it as runnable.
Definition at line 278 of file coord_pair.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Compare two requests by priority and sequence.
Definition at line 546 of file coord_pair.c.
Here is the caller graph for this function:
|
static |
Signal the unlang interpreter that it needs to stop running the request.
| [in] | request | request to cancel. The request may still run to completion. |
Definition at line 235 of file coord_pair.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Definition at line 615 of file coord_pair.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Create the coord_pair coord instance data.
Definition at line 559 of file coord_pair.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void fr_coord_pair_data_recv | ( | UNUSED fr_coord_t * | coord, |
| uint32_t | worker_id, | ||
| fr_dbuff_t * | dbuff, | ||
| fr_time_t | now, | ||
| void * | inst, | ||
| void * | uctx | ||
| ) |
Callback run when a coordinator receives pair list data.
Converts the data into a request.
Definition at line 666 of file coord_pair.c.
Here is the call graph for this function:
|
static |
Event callback in multi threaded mode.
Definition at line 655 of file coord_pair.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_coord_cb_inst_t * fr_coord_pair_inst_create | ( | TALLOC_CTX * | ctx, |
| fr_coord_t * | coord, | ||
| fr_event_list_t * | el, | ||
| bool | single_thread, | ||
| void * | uctx | ||
| ) |
Plugin creation called during coordinator creation.
| ctx | to allocate the plugin in. |
| el | Event list for plugin to use. |
| single_thread | is the server in single thread mode. |
| uctx | configured for the callback this plugin relates to. |
Definition at line 783 of file coord_pair.c.
Here is the call graph for this function:
|
static |
Definition at line 646 of file coord_pair.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 637 of file coord_pair.c.
Here is the call graph for this function:
Here is the caller graph for this function:| uint32_t fr_coord_pair_reg_cb_id | ( | fr_coord_pair_reg_t * | coord_pair_reg | ) |
Return the coordinator callback ID associated with a coord_pair_reg_t.
Definition at line 220 of file coord_pair.c.
| fr_coord_pair_reg_t * fr_coord_pair_register | ( | TALLOC_CTX * | ctx, |
| fr_coord_pair_reg_ctx_t * | reg_ctx | ||
| ) |
Register a set of callbacks for pair list based coordinator messages.
Returns a structure to pass as uctx to fr_coord_cb_t using the macro FR_COORD_PAIR_CB_CTX_SET.
| ctx | to allocate the registration under. |
| reg_ctx | Callback details to register. |
Definition at line 113 of file coord_pair.c.
Here is the call graph for this function:
|
static |
Set, or re-set the request timer.
| [in] | coord_pair | the coord_pair_t containing the timeout lists. |
| [in] | request | that we're timing out. |
| [in] | timeout | the timeout to set. |
Definition at line 265 of file coord_pair.c.
Here is the call graph for this function:
Here is the caller graph for this function:Send a reply list from a coordinator to a worker.
| request | containing the reply to send. |
| worker_id | to send the reply to. |
Definition at line 724 of file coord_pair.c.
Here is the call graph for this function:| void fr_coord_worker_pair_data_recv | ( | fr_coord_worker_t * | cw, |
| fr_dbuff_t * | dbuff, | ||
| fr_time_t | now, | ||
| void * | uctx | ||
| ) |
Callback run when a worker receives pair list data.
Finds the packet type attribute in the data and calls the callback registered against the value of that attribute.
| cw | Worker which received the message. |
| dbuff | Data received. |
| now | Time the data is received. |
| uctx | The coord_pair registration. |
Definition at line 685 of file coord_pair.c.
Here is the call graph for this function:| int fr_worker_to_coord_pair_send | ( | fr_coord_worker_t * | cw, |
| fr_coord_pair_reg_t * | coord_pair_reg, | ||
| fr_pair_list_t * | list | ||
| ) |
Send a pair list from a worker to a coordinator.
The pair list must include an attribute indicating the packet type
| cw | The coord worker sending the data. |
| list | of pairs to send. |
Definition at line 755 of file coord_pair.c.
Here is the call graph for this function:
|
static |
Conf parser to read slab settings from module config.
Definition at line 84 of file coord_pair.c.
1.9.8