![]() |
The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
|
#include <freeradius-devel/server/base.h>#include <freeradius-devel/io/channel.h>#include <freeradius-devel/io/control.h>#include <freeradius-devel/io/message.h>#include <freeradius-devel/util/debug.h>#include <freeradius-devel/util/event.h>#include <freeradius-devel/util/rand.h>#include <freeradius-devel/util/syserror.h>#include <freeradius-devel/util/talloc.h>#include <freeradius-devel/util/stdatomic.h>#include <pthread.h>
Include dependency graph for channel_test.c:Go to the source code of this file.
Data Structures | |
| struct | payload_t |
| What travels in each request, and is echoed back in its reply. More... | |
| struct | req_channel_t |
| A requestor's view of one channel. More... | |
| struct | requestor_s |
| struct | resp_channel_t |
| A responder's view of one channel. More... | |
| struct | responder_s |
Macros | |
| #define | MPRINT1 if (debug_lvl) printf |
| #define | MPRINT2 if (debug_lvl > 1) printf |
| #define | PAYLOAD_SIZE (sizeof(payload_t)) |
Typedefs | |
| typedef struct requestor_s | requestor_t |
| typedef struct responder_s | responder_t |
Functions | |
| static | _Atomic (uint64_t) |
| static void | dump_state (void) |
| int | main (int argc, char *argv[]) |
| static void | requestor_closed (fr_channel_t *ch, UNUSED fr_time_t now, void *uctx) |
| static void | requestor_recv_reply (fr_channel_t *ch, fr_channel_data_t *cd, UNUSED void *uctx) |
| static void * | requestor_thread (void *arg) |
| static void | responder_close (fr_channel_t *ch, UNUSED fr_time_t now, void *uctx) |
| static void | responder_open (fr_channel_t *ch, fr_message_set_t *reply_ms, UNUSED fr_time_t now, void *uctx) |
| static void | responder_recv_request (fr_channel_t *ch, fr_channel_data_t *cd, void *uctx) |
| static void | responder_run (responder_t *w) |
| Reply to everything pending at the start of this pass. | |
| static bool | responder_sleeping (responder_t *w) |
| The responder half of the handshake, as fr_worker() does it. | |
| static void * | responder_thread (void *arg) |
| static void | spin (uint32_t max_usec) |
| Burn a random amount of time without a syscall. | |
| static void * | watchdog_thread (UNUSED void *arg) |
Variables | |
| static bool | broken = false |
| static int | debug_lvl = 0 |
| static uint64_t | max_messages = 100000 |
| static uint64_t | max_outstanding = 64 |
| static uint32_t | max_pause_usec = 20 |
| static uint32_t | max_work_usec = 2 |
| static size_t | num_requestors = 2 |
| static size_t | num_responders = 4 |
| static fr_channel_callbacks_t const | requestor_callbacks |
| static requestor_t * | requestors |
| static fr_channel_callbacks_t const | responder_callbacks |
| static responder_t * | responders |
| static size_t | set_messages = 0 |
| message set size override, 0 for automatic. | |
| static unsigned int | watchdog_secs = 5 |
| struct payload_t |
What travels in each request, and is echoed back in its reply.
Definition at line 53 of file channel_test.c.
| Data Fields | ||
|---|---|---|
| uint64_t | requestor | |
| uint64_t | responder | |
| uint64_t | seq | |
| struct req_channel_t |
A requestor's view of one channel.
Definition at line 66 of file channel_test.c.
Collaboration diagram for req_channel_t:| Data Fields | ||
|---|---|---|
| fr_channel_t * | ch | |
| bool | closed | |
| bool | closing | |
| uint64_t | last_seq | of the last reply, replies must arrive in order. |
| uint64_t | outstanding | |
| uint64_t | replied | |
| fr_message_set_t * | reply_ms | replies are allocated from this by the responder. |
| requestor_t * | requestor | |
| size_t | responder | index of the responder at the other end. |
| uint64_t | sent | |
| struct requestor_s |
Definition at line 81 of file channel_test.c.
Collaboration diagram for requestor_s:| Data Fields | ||
|---|---|---|
| req_channel_t * | channel | one per responder. |
| fr_control_t * | control | |
| fr_event_list_t * | el | |
| size_t | id | |
| fr_message_set_t * | ms | requests are allocated from this. |
| size_t | num_closed | |
| struct resp_channel_t |
A responder's view of one channel.
Definition at line 93 of file channel_test.c.
Collaboration diagram for resp_channel_t:| Data Fields | ||
|---|---|---|
| fr_channel_t * | ch | |
| fr_message_set_t * | reply_ms | |
| struct responder_s |
Definition at line 98 of file channel_test.c.
Collaboration diagram for responder_s:| Data Fields | ||
|---|---|---|
| resp_channel_t * | channel | one slot per requestor. |
| fr_control_t * | control | |
| fr_event_list_t * | el | |
| size_t | id | |
| size_t | num_channels | |
| size_t | num_closed | |
| fr_channel_data_t ** | pending | requests received but not yet replied to. |
| size_t | pending_head | |
| size_t | pending_num | |
| size_t | pending_size | |
| uint64_t | received | |
| uint64_t | rescued | final drains which found work, i.e. skipped signals we caught. |
| bool | running | |
| uint64_t | sleeps | times we blocked. |
Definition at line 48 of file channel_test.c.
Definition at line 49 of file channel_test.c.
Definition at line 59 of file channel_test.c.
| typedef struct requestor_s requestor_t |
Definition at line 61 of file channel_test.c.
| typedef struct responder_s responder_t |
Definition at line 62 of file channel_test.c.
|
static |
Definition at line 132 of file channel_test.c.
|
static |
Definition at line 482 of file channel_test.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
|
static |
|
static |
Definition at line 173 of file channel_test.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 211 of file channel_test.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
|
static |
|
static |
|
static |
Reply to everything pending at the start of this pass.
Replies made during the pass may queue more requests, which wait for the next pass, as they would in the worker.
Definition at line 404 of file channel_test.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
The responder half of the handshake, as fr_worker() does it.
Definition at line 377 of file channel_test.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 444 of file channel_test.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Burn a random amount of time without a syscall.
Definition at line 157 of file channel_test.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 507 of file channel_test.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 126 of file channel_test.c.
|
static |
Definition at line 118 of file channel_test.c.
|
static |
Definition at line 121 of file channel_test.c.
|
static |
Definition at line 122 of file channel_test.c.
|
static |
Definition at line 124 of file channel_test.c.
|
static |
Definition at line 123 of file channel_test.c.
|
static |
Definition at line 119 of file channel_test.c.
|
static |
Definition at line 120 of file channel_test.c.
|
static |
Definition at line 207 of file channel_test.c.
|
static |
Definition at line 129 of file channel_test.c.
|
static |
Definition at line 368 of file channel_test.c.
|
static |
Definition at line 130 of file channel_test.c.
|
static |
message set size override, 0 for automatic.
Definition at line 127 of file channel_test.c.
|
static |
Definition at line 125 of file channel_test.c.
1.9.8