The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Loading...
Searching...
No Matches
Data Structures | Macros | Functions | Variables
control_test.c File Reference
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/io/control.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/util/syserror.h>
#include <freeradius-devel/util/talloc.h>
#include <freeradius-devel/util/time.h>
#include <sys/event.h>
#include <stdio.h>
#include <string.h>
#include <pthread.h>
+ Include dependency graph for control_test.c:

Go to the source code of this file.

Data Structures

struct  master_ctx_t
 
struct  my_message_t
 
struct  worker_args_t
 

Macros

#define CONTROL_MAGIC   0xabcd6809
 
#define MEM(x)   if (!(x)) { fprintf(stderr, "%s[%u] OUT OF MEMORY\n", __FILE__, __LINE__); _exit(EXIT_FAILURE); }
 
#define MPRINT1   if (debug_lvl) printf
 
#define MPRINT2   if (debug_lvl >= 2) printf
 
#define MPRINT3   if (debug_lvl >= 3) printf
 

Functions

static void * control_master (UNUSED void *arg)
 
static void * control_worker (void *arg)
 
int main (int argc, char *argv[])
 
static void recv_control_callback (void *ctx, void const *data, size_t data_size, UNUSED fr_time_t now)
 
static NEVER_RETURNS void usage (void)
 

Variables

static fr_atomic_queue_t ** aq
 
static int aq_size = 16
 
static fr_control_t ** control = NULL
 
static int debug_lvl = 0
 
static fr_event_list_tel = NULL
 
static size_t max_messages = 10
 
static size_t num_aq = 1
 
static size_t num_workers = 1
 
static bool single_aq = true
 

Data Structure Documentation

◆ master_ctx_t

struct master_ctx_t

Definition at line 82 of file control_test.c.

Data Fields
size_t num_messages

◆ my_message_t

struct my_message_t

Definition at line 76 of file control_test.c.

Data Fields
size_t counter
uint32_t header
size_t worker

◆ worker_args_t

struct worker_args_t

Definition at line 48 of file control_test.c.

+ Collaboration diagram for worker_args_t:
Data Fields
size_t id
fr_ring_buffer_t * rb

Macro Definition Documentation

◆ CONTROL_MAGIC

#define CONTROL_MAGIC   0xabcd6809

Definition at line 46 of file control_test.c.

◆ MEM

#define MEM (   x)    if (!(x)) { fprintf(stderr, "%s[%u] OUT OF MEMORY\n", __FILE__, __LINE__); _exit(EXIT_FAILURE); }

Definition at line 42 of file control_test.c.

◆ MPRINT1

#define MPRINT1   if (debug_lvl) printf

Definition at line 43 of file control_test.c.

◆ MPRINT2

#define MPRINT2   if (debug_lvl >= 2) printf

Definition at line 44 of file control_test.c.

◆ MPRINT3

#define MPRINT3   if (debug_lvl >= 3) printf

Definition at line 45 of file control_test.c.

Function Documentation

◆ control_master()

static void * control_master ( UNUSED void *  arg)
static

Definition at line 99 of file control_test.c.

+ Here is the call graph for this function:

◆ control_worker()

static void * control_worker ( void *  arg)
static

Definition at line 137 of file control_test.c.

+ Here is the call graph for this function:

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 177 of file control_test.c.

+ Here is the call graph for this function:

◆ recv_control_callback()

static void recv_control_callback ( void *  ctx,
void const *  data,
size_t  data_size,
UNUSED fr_time_t  now 
)
static

Definition at line 86 of file control_test.c.

+ Here is the caller graph for this function:

◆ usage()

static NEVER_RETURNS void usage ( void  )
static

Definition at line 65 of file control_test.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ aq

fr_atomic_queue_t** aq
static

Definition at line 54 of file control_test.c.

◆ aq_size

int aq_size = 16
static

Definition at line 57 of file control_test.c.

◆ control

fr_control_t** control = NULL
static

Definition at line 58 of file control_test.c.

◆ debug_lvl

int debug_lvl = 0
static

Definition at line 53 of file control_test.c.

◆ el

fr_event_list_t* el = NULL
static

Definition at line 59 of file control_test.c.

◆ max_messages

size_t max_messages = 10
static

Definition at line 55 of file control_test.c.

◆ num_aq

size_t num_aq = 1
static

Definition at line 61 of file control_test.c.

◆ num_workers

size_t num_workers = 1
static

Definition at line 56 of file control_test.c.

◆ single_aq

bool single_aq = true
static

Definition at line 60 of file control_test.c.