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

Internal implementation of radmin. More...

#include <freeradius-devel/io/schedule.h>
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/server/radmin.h>
#include <freeradius-devel/util/dict.h>
#include <freeradius-devel/util/misc.h>
#include <freeradius-devel/util/socket.h>
+ Include dependency graph for radmin.c:

Go to the source code of this file.

Macros

#define CMD_MAX_ARGV   (32)
 
#define CMD_MAX_EXPANSIONS   (128)
 
#define radmin_free(_x)
 

Functions

static void add_history (UNUSED char *line)
 
static int cmd_exit (FILE *fp, FILE *fp_err, UNUSED void *ctx, fr_cmd_info_t const *info)
 
static int cmd_exit (UNUSED FILE *fp, UNUSED FILE *fp_err, UNUSED void *ctx, UNUSED fr_cmd_info_t const *info)
 
static int cmd_help (FILE *fp, UNUSED FILE *fp_err, UNUSED void *ctx, fr_cmd_info_t const *info)
 
static int cmd_set_debug_level (UNUSED FILE *fp, FILE *fp_err, UNUSED void *ctx, fr_cmd_info_t const *info)
 
static int cmd_show_client (FILE *fp, FILE *fp_err, UNUSED void *ctx, fr_cmd_info_t const *info)
 
static int cmd_show_config_item (FILE *fp, FILE *fp_err, UNUSED void *ctx, fr_cmd_info_t const *info)
 
static int cmd_show_config_section (FILE *fp, FILE *fp_err, UNUSED void *ctx, fr_cmd_info_t const *info)
 
static int cmd_show_debug_level (FILE *fp, UNUSED FILE *fp_err, UNUSED void *ctx, UNUSED fr_cmd_info_t const *info)
 
static int cmd_stats_memory (FILE *fp, FILE *fp_err, UNUSED void *ctx, fr_cmd_info_t const *info)
 
static int cmd_terminate (UNUSED FILE *fp, UNUSED FILE *fp_err, UNUSED void *ctx, UNUSED fr_cmd_info_t const *info)
 
static int cmd_uptime (FILE *fp, UNUSED FILE *fp_err, UNUSED void *ctx, UNUSED fr_cmd_info_t const *info)
 
static void * fr_radmin (UNUSED void *input_ctx)
 
void fr_radmin_complete (FILE *fp, const char *text, int start)
 
void fr_radmin_help (FILE *fp, char const *text)
 
int fr_radmin_register (UNUSED TALLOC_CTX *talloc_ctx, char const *name, void *ctx, fr_cmd_table_t *table)
 
int fr_radmin_run (fr_cmd_info_t *info, FILE *fp, FILE *fp_err, char *str, bool read_only)
 Run a command from an input string. More...
 
int fr_radmin_start (main_config_t *config, bool cli)
 
void fr_radmin_stop (void)
 
static char * readline (char const *prompt)
 
static int tab_expand_config_item (TALLOC_CTX *talloc_ctx, void *ctx, fr_cmd_info_t *info, int max_expansions, char const **expansions)
 
static int tab_expand_config_section (TALLOC_CTX *talloc_ctx, void *ctx, fr_cmd_info_t *info, int max_expansions, char const **expansions)
 
static int tab_expand_config_thing (TALLOC_CTX *talloc_ctx, UNUSED void *ctx, fr_cmd_info_t *info, int max_expansions, char const **expansions, bool want_section)
 

Variables

static pthread_t cli_pthread_id
 
static bool cli_started = false
 
static fr_cmd_table_t cmd_table []
 
static int context = 0
 
static char * radmin_buffer = NULL
 
static fr_cmd_tradmin_cmd = NULL
 
static TALLOC_CTX * radmin_ctx = NULL
 
static fr_cmd_info_t radmin_info
 
static main_config_tradmin_main_config = NULL
 
static char * radmin_partial_line = NULL
 
static char readline_buffer [1024]
 
static fr_time_t start_time
 radmin functions, tables, and callbacks More...
 
static bool stop = false
 

Detailed Description

Internal implementation of radmin.

Id
6bfd234d56f0ce0ba9b5c032dbf41d7b9adbba83

Definition in file radmin.c.

Macro Definition Documentation

◆ CMD_MAX_ARGV

#define CMD_MAX_ARGV   (32)

Definition at line 150 of file radmin.c.

◆ CMD_MAX_EXPANSIONS

#define CMD_MAX_EXPANSIONS   (128)

Definition at line 151 of file radmin.c.

◆ radmin_free

#define radmin_free (   _x)

Definition at line 135 of file radmin.c.

Function Documentation

◆ add_history()

static void add_history ( UNUSED char *  line)
static

Definition at line 141 of file radmin.c.

+ Here is the caller graph for this function:

◆ cmd_exit() [1/2]

static int cmd_exit ( FILE *  fp,
FILE *  fp_err,
UNUSED void *  ctx,
fr_cmd_info_t const *  info 
)
static
+ Here is the caller graph for this function:

◆ cmd_exit() [2/2]

static int cmd_exit ( UNUSED FILE *  fp,
UNUSED FILE *  fp_err,
UNUSED void *  ctx,
UNUSED fr_cmd_info_t const *  info 
)
static

Definition at line 423 of file radmin.c.

+ Here is the call graph for this function:

◆ cmd_help()

static int cmd_help ( FILE *  fp,
UNUSED FILE *  fp_err,
UNUSED void *  ctx,
fr_cmd_info_t const *  info 
)
static

Definition at line 431 of file radmin.c.

+ Here is the call graph for this function:

◆ cmd_set_debug_level()

static int cmd_set_debug_level ( UNUSED FILE *  fp,
FILE *  fp_err,
UNUSED void *  ctx,
fr_cmd_info_t const *  info 
)
static

Definition at line 499 of file radmin.c.

◆ cmd_show_client()

static int cmd_show_client ( FILE *  fp,
FILE *  fp_err,
UNUSED void *  ctx,
fr_cmd_info_t const *  info 
)
static

Definition at line 782 of file radmin.c.

+ Here is the call graph for this function:

◆ cmd_show_config_item()

static int cmd_show_config_item ( FILE *  fp,
FILE *  fp_err,
UNUSED void *  ctx,
fr_cmd_info_t const *  info 
)
static

Definition at line 732 of file radmin.c.

+ Here is the call graph for this function:

◆ cmd_show_config_section()

static int cmd_show_config_section ( FILE *  fp,
FILE *  fp_err,
UNUSED void *  ctx,
fr_cmd_info_t const *  info 
)
static

Definition at line 703 of file radmin.c.

+ Here is the call graph for this function:

◆ cmd_show_debug_level()

static int cmd_show_debug_level ( FILE *  fp,
UNUSED FILE *  fp_err,
UNUSED void *  ctx,
UNUSED fr_cmd_info_t const *  info 
)
static

Definition at line 512 of file radmin.c.

◆ cmd_stats_memory()

static int cmd_stats_memory ( FILE *  fp,
FILE *  fp_err,
UNUSED void *  ctx,
fr_cmd_info_t const *  info 
)
static

Definition at line 468 of file radmin.c.

+ Here is the call graph for this function:

◆ cmd_terminate()

static int cmd_terminate ( UNUSED FILE *  fp,
UNUSED FILE *  fp_err,
UNUSED void *  ctx,
UNUSED fr_cmd_info_t const *  info 
)
static

Definition at line 451 of file radmin.c.

+ Here is the call graph for this function:

◆ cmd_uptime()

static int cmd_uptime ( FILE *  fp,
UNUSED FILE *  fp_err,
UNUSED void *  ctx,
UNUSED fr_cmd_info_t const *  info 
)
static

Definition at line 457 of file radmin.c.

+ Here is the call graph for this function:

◆ fr_radmin()

static void* fr_radmin ( UNUSED void *  input_ctx)
static

Definition at line 230 of file radmin.c.

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

◆ fr_radmin_complete()

void fr_radmin_complete ( FILE *  fp,
const char *  text,
int  start 
)

Definition at line 1171 of file radmin.c.

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

◆ fr_radmin_help()

void fr_radmin_help ( FILE *  fp,
char const *  text 
)

Definition at line 1166 of file radmin.c.

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

◆ fr_radmin_register()

int fr_radmin_register ( UNUSED TALLOC_CTX *  talloc_ctx,
char const *  name,
void *  ctx,
fr_cmd_table_t table 
)

Definition at line 1118 of file radmin.c.

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

◆ fr_radmin_run()

int fr_radmin_run ( fr_cmd_info_t info,
FILE *  fp,
FILE *  fp_err,
char *  str,
bool  read_only 
)

Run a command from an input string.

Parameters
infoused to stor
fpstandard output
fp_errerror output
strthe command to run. Note that this command is mangled in-place!
read_onlypermissions for the administrator trying to run the command.
Returns
  • <0 on error
  • 0 on insufficient arguments to run command
  • 1 for successfully running the command

Definition at line 1135 of file radmin.c.

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

◆ fr_radmin_start()

int fr_radmin_start ( main_config_t config,
bool  cli 
)

Definition at line 1064 of file radmin.c.

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

◆ fr_radmin_stop()

void fr_radmin_stop ( void  )

Definition at line 1101 of file radmin.c.

+ Here is the caller graph for this function:

◆ readline()

static char* readline ( char const *  prompt)
static

Definition at line 81 of file radmin.c.

+ Here is the caller graph for this function:

◆ tab_expand_config_item()

static int tab_expand_config_item ( TALLOC_CTX *  talloc_ctx,
void *  ctx,
fr_cmd_info_t info,
int  max_expansions,
char const **  expansions 
)
static

Definition at line 727 of file radmin.c.

+ Here is the call graph for this function:

◆ tab_expand_config_section()

static int tab_expand_config_section ( TALLOC_CTX *  talloc_ctx,
void *  ctx,
fr_cmd_info_t info,
int  max_expansions,
char const **  expansions 
)
static

Definition at line 722 of file radmin.c.

+ Here is the call graph for this function:

◆ tab_expand_config_thing()

static int tab_expand_config_thing ( TALLOC_CTX *  talloc_ctx,
UNUSED void *  ctx,
fr_cmd_info_t info,
int  max_expansions,
char const **  expansions,
bool  want_section 
)
static

Definition at line 583 of file radmin.c.

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

Variable Documentation

◆ cli_pthread_id

pthread_t cli_pthread_id
static

Definition at line 68 of file radmin.c.

◆ cli_started

bool cli_started = false
static

Definition at line 69 of file radmin.c.

◆ cmd_table

fr_cmd_table_t cmd_table[]
static

Definition at line 876 of file radmin.c.

◆ context

int context = 0
static

Definition at line 71 of file radmin.c.

◆ radmin_buffer

char* radmin_buffer = NULL
static

Definition at line 148 of file radmin.c.

◆ radmin_cmd

fr_cmd_t* radmin_cmd = NULL
static

Definition at line 146 of file radmin.c.

◆ radmin_ctx

TALLOC_CTX* radmin_ctx = NULL
static

Definition at line 73 of file radmin.c.

◆ radmin_info

fr_cmd_info_t radmin_info
static

Definition at line 72 of file radmin.c.

◆ radmin_main_config

main_config_t* radmin_main_config = NULL
static

Definition at line 154 of file radmin.c.

◆ radmin_partial_line

char* radmin_partial_line = NULL
static

Definition at line 147 of file radmin.c.

◆ readline_buffer

char readline_buffer[1024]
static

Definition at line 79 of file radmin.c.

◆ start_time

fr_time_t start_time
static

radmin functions, tables, and callbacks

Definition at line 421 of file radmin.c.

◆ stop

bool stop = false
static

Definition at line 70 of file radmin.c.