The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Macros | Functions | Variables
radiusd.c File Reference

Main loop of the radius server. More...

#include <freeradius-devel/server/base.h>
#include <freeradius-devel/server/dependency.h>
#include <freeradius-devel/server/map_proc.h>
#include <freeradius-devel/server/module.h>
#include <freeradius-devel/server/radmin.h>
#include <freeradius-devel/server/state.h>
#include <freeradius-devel/server/virtual_servers.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/util/size.h>
#include <freeradius-devel/util/strerror.h>
#include <freeradius-devel/tls/base.h>
#include <freeradius-devel/tls/log.h>
#include <freeradius-devel/unlang/base.h>
#include <freeradius-devel/util/misc.h>
#include <freeradius-devel/util/syserror.h>
#include <ctype.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/file.h>
#include <sys/mman.h>
+ Include dependency graph for radiusd.c:

Go to the source code of this file.

Macros

#define COPY(_x)   schedule->worker._x = config->_x
 
#define DUMP_CAPABILITIES(_phase)
 
#define EXIT_WITH_FAILURE
 
#define EXIT_WITH_SUCCESS
 
#define WEXITSTATUS(stat_val)   ((unsigned)(stat_val) >> 8)
 
#define WIFEXITED(stat_val)   (((stat_val) & 255) == 0)
 

Functions

static void fr_exit_after (fr_event_list_t *el, fr_time_t now, void *uctx)
 Encourage the server to exit after a period of time. More...
 
static void fr_time_sync_event (fr_event_list_t *el, UNUSED fr_time_t now, UNUSED void *uctx)
 
int main (int argc, char *argv[])
 Entry point for the daemon. More...
 
static void sig_fatal (int)
 
static int talloc_config_set (main_config_t *config)
 Configure talloc debugging features. More...
 
static void thread_detach (UNUSED void *uctx)
 Explicitly cleanup module/xlat resources. More...
 
static int thread_instantiate (TALLOC_CTX *ctx, fr_event_list_t *el, UNUSED void *uctx)
 Create module and xlat per-thread instances. More...
 
static void usage (main_config_t const *config, int status)
 

Variables

static fr_event_timer_t const * fr_time_sync_ev = NULL
 
static pid_t radius_pid
 
char const * radiusd_version = RADIUSD_VERSION_BUILD("FreeRADIUS")
 

Detailed Description

Main loop of the radius server.

Id
f864edef9cfece035c6493fe3dd869cce95de17a

Definition in file radiusd.c.

Macro Definition Documentation

◆ COPY

#define COPY (   _x)    schedule->worker._x = config->_x

◆ DUMP_CAPABILITIES

#define DUMP_CAPABILITIES (   _phase)

Definition at line 217 of file radiusd.c.

◆ EXIT_WITH_FAILURE

#define EXIT_WITH_FAILURE
Value:
do { \
ret = EXIT_FAILURE; \
goto cleanup; \
} while (0)
static bool cleanup
Definition: radsniff.c:60

Definition at line 158 of file radiusd.c.

◆ EXIT_WITH_SUCCESS

#define EXIT_WITH_SUCCESS
Value:
do { \
ret = EXIT_SUCCESS; \
goto cleanup; \
} while (0)

Definition at line 164 of file radiusd.c.

◆ WEXITSTATUS

#define WEXITSTATUS (   stat_val)    ((unsigned)(stat_val) >> 8)

Definition at line 69 of file radiusd.c.

◆ WIFEXITED

#define WIFEXITED (   stat_val)    (((stat_val) & 255) == 0)

Definition at line 72 of file radiusd.c.

Function Documentation

◆ fr_exit_after()

static void fr_exit_after ( fr_event_list_t el,
fr_time_t  now,
void *  uctx 
)
static

Encourage the server to exit after a period of time.

Parameters
[in]elThe main loop.
[in]nowCurrent time. Should be 0, when adding the event.
[in]uctxPointer to a fr_time_delta_t indicating how long the server should run before exit.

Definition at line 188 of file radiusd.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_time_sync_event()

static void fr_time_sync_event ( fr_event_list_t el,
UNUSED fr_time_t  now,
UNUSED void *  uctx 
)
static

Definition at line 172 of file radiusd.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ main()

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

Entry point for the daemon.

Definition at line 224 of file radiusd.c.

◆ sig_fatal()

static void sig_fatal ( int  sig)
static

Definition at line 1203 of file radiusd.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ talloc_config_set()

static int talloc_config_set ( main_config_t config)
static

Configure talloc debugging features.

Parameters
[in]configThe main config.
Returns
  • 1 on config conflict.
  • 0 on success.
  • -1 on error.

Definition at line 108 of file radiusd.c.

+ Here is the caller graph for this function:

◆ thread_detach()

static void thread_detach ( UNUSED void *  uctx)
static

Explicitly cleanup module/xlat resources.

Definition at line 149 of file radiusd.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ thread_instantiate()

static int thread_instantiate ( TALLOC_CTX *  ctx,
fr_event_list_t el,
UNUSED void *  uctx 
)
static

Create module and xlat per-thread instances.

Definition at line 132 of file radiusd.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ usage()

static NEVER_RETURNS void usage ( main_config_t const *  config,
int  status 
)
static

Definition at line 1166 of file radiusd.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ fr_time_sync_ev

fr_event_timer_t const* fr_time_sync_ev = NULL
static

Definition at line 170 of file radiusd.c.

◆ radius_pid

pid_t radius_pid
static

Definition at line 84 of file radiusd.c.

◆ radiusd_version

char const* radiusd_version = RADIUSD_VERSION_BUILD("FreeRADIUS")

Definition at line 83 of file radiusd.c.