All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
command.c File Reference
#include <freeradius-devel/parser.h>
#include <freeradius-devel/md5.h>
#include <freeradius-devel/channel.h>
#include <freeradius-devel/state.h>
#include <libgen.h>
#include <pwd.h>
#include <grp.h>
+ Include dependency graph for command.c:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  fr_command_socket_t
 
struct  fr_command_table_t
 
struct  fr_cs_buffer_t
 

Macros

#define CMD_FAIL   FR_CHANNEL_FAIL
 
#define CMD_OK   FR_CHANNEL_SUCCESS
 
#define COMMAND_BUFFER_SIZE   (1024)
 
#define COMMAND_SOCKET_MAGIC   (0xffdeadee)
 
#define FR_READ   (1)
 
#define FR_WRITE   (2)
 
#define MAX_ARGV   (16)
 
#define PU   "%u"
 

Typedefs

typedef int(* fr_command_func_t )(rad_listen_t *, int, char *argv[])
 
typedef struct fr_command_socket_t fr_command_socket_t
 
typedef struct fr_command_table_t fr_command_table_t
 
typedef struct fr_cs_buffer_t fr_cs_buffer_t
 

Functions

static ssize_t CC_HINT (format(printf, 2, 3))
 
static int command_add_client_file (rad_listen_t *listener, int argc, char *argv[])
 
static void command_close_socket (rad_listen_t *this)
 
static int command_debug_condition (rad_listen_t *listener, int argc, char *argv[])
 
static int command_debug_file (rad_listen_t *listener, int argc, char *argv[])
 
static int command_debug_level (rad_listen_t *listener, int argc, char *argv[])
 
static void command_debug_off (void)
 
static int command_del_client (rad_listen_t *listener, int argc, char *argv[])
 
static int command_domain_accept (rad_listen_t *listener)
 
static int command_domain_recv (rad_listen_t *listener)
 
static int command_domain_recv_co (rad_listen_t *listener, fr_cs_buffer_t *co)
 
static int command_domain_send (UNUSED rad_listen_t *listener, UNUSED REQUEST *request)
 
static int command_hup (rad_listen_t *listener, int argc, char *argv[])
 
static int command_inject_file (rad_listen_t *listener, int argc, char *argv[])
 
static int command_inject_from (rad_listen_t *listener, int argc, char *argv[])
 
static int command_inject_to (rad_listen_t *listener, int argc, char *argv[])
 
static int command_print_stats (rad_listen_t *listener, fr_stats_t *stats, int auth, int server)
 
static int command_set_home_server_state (rad_listen_t *listener, int argc, char *argv[])
 
static int command_set_module_config (rad_listen_t *listener, int argc, char *argv[])
 
static int command_set_module_status (rad_listen_t *listener, int argc, char *argv[])
 
static int command_show_clients (rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[])
 
static int command_show_config (rad_listen_t *listener, int argc, char *argv[])
 
static int command_show_debug_condition (rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[])
 
static int command_show_debug_file (rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[])
 
static int command_show_debug_level (rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[])
 
static int command_show_home_server_state (rad_listen_t *listener, int argc, char *argv[])
 
static int command_show_home_servers (rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[])
 
static int command_show_module_config (rad_listen_t *listener, int argc, char *argv[])
 
static int command_show_module_flags (rad_listen_t *listener, int argc, char *argv[])
 
static int command_show_module_methods (rad_listen_t *listener, int argc, char *argv[])
 
static int command_show_module_status (rad_listen_t *listener, int argc, char *argv[])
 
static int command_show_modules (rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[])
 
static int command_show_version (rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[])
 
static int command_socket_decode (UNUSED rad_listen_t *listener, UNUSED REQUEST *request)
 
static int command_socket_encode (UNUSED rad_listen_t *listener, UNUSED REQUEST *request)
 
static void command_socket_free (rad_listen_t *this)
 
static int command_socket_open (CONF_SECTION *cs, rad_listen_t *this)
 
static int command_socket_open_unix (UNUSED CONF_SECTION *cs, rad_listen_t *this)
 
static int command_socket_parse (CONF_SECTION *cs, rad_listen_t *this)
 
static int command_socket_parse_unix (CONF_SECTION *cs, rad_listen_t *this)
 
static int command_socket_print (rad_listen_t const *this, char *buffer, size_t bufsize)
 
static int command_stats_client (rad_listen_t *listener, int argc, char *argv[])
 
static int command_stats_detail (rad_listen_t *listener, int argc, char *argv[])
 
static int command_stats_home_server (rad_listen_t *listener, int argc, char *argv[])
 
static int command_stats_memory (rad_listen_t *listener, int argc, char *argv[])
 
static int command_stats_socket (rad_listen_t *listener, int argc, char *argv[])
 
static int command_stats_state (rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[])
 
static int command_tcp_recv (rad_listen_t *this)
 
static int command_tcp_send (UNUSED rad_listen_t *listener, UNUSED REQUEST *request)
 
static int command_terminate (UNUSED rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[])
 
static int command_uptime (rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[])
 
static int command_write_magic (int newfd, listen_socket_t *sock)
 
static void cprint_conf_parser (rad_listen_t *listener, int indent, CONF_SECTION *cs, void const *base)
 
static int dict_str_to_argvX (char *str, char **argv, int max_argc)
 
static int fr_server_domain_socket_peercred (char const *path, uid_t UNUSED uid, UNUSED gid_t gid)
 Initialise a socket for use with peercred authentication. More...
 
static int fr_server_domain_socket_perm (UNUSED char const *path, UNUSED uid_t uid, UNUSED gid_t gid)
 
static RADCLIENTget_client (rad_listen_t *listener, int argc, char *argv[])
 
static home_server_tget_home_server (rad_listen_t *listener, int argc, char *argv[], int *last)
 
static rad_listen_tget_socket (rad_listen_t *listener, int argc, char *argv[], int *last)
 
static int null_socket_dencode (UNUSED rad_listen_t *listener, UNUSED REQUEST *request)
 
static int null_socket_send (UNUSED rad_listen_t *listener, REQUEST *request)
 
static void print_help (rad_listen_t *listener, int argc, char *argv[], fr_command_table_t *table, int recursive)
 

Variables

static const CONF_PARSER command_config []
 
static fr_command_table_t command_table []
 
static fr_command_table_t command_table_add []
 
static fr_command_table_t command_table_add_client []
 
static fr_command_table_t command_table_debug []
 
static fr_command_table_t command_table_del []
 
static fr_command_table_t command_table_del_client []
 
static fr_command_table_t command_table_inject []
 
static fr_command_table_t command_table_set []
 
static fr_command_table_t command_table_set_home []
 
static fr_command_table_t command_table_set_module []
 
static fr_command_table_t command_table_show []
 
static fr_command_table_t command_table_show_client []
 
static fr_command_table_t command_table_show_debug []
 
static fr_command_table_t command_table_show_home []
 
static fr_command_table_t command_table_show_module []
 
static fr_command_table_t command_table_stats []
 
fr_cond_tdebug_condition = NULL
 Condition used to mark packets up for checking. More...
 
fr_log_t debug_log = { .fd = -1, .dst = L_DST_NULL }
 
static char debug_log_file_buffer [1024]
 
static char const * elapsed_names [8]
 
static char const * method_names [MOD_COUNT]
 
static FR_NAME_NUMBER mode_names []
 
static FR_NAME_NUMBER state_names []
 
static char const tabs [] = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"
 

Data Structure Documentation

struct fr_command_socket_t

Definition at line 83 of file command.c.

+ Collaboration diagram for fr_command_socket_t:
Data Fields
fr_cs_buffer_t co
char * copy
fr_ipaddr_t dst_ipaddr
uint16_t dst_port
gid_t gid
char const * gid_name
RADCLIENT * inject_client
rad_listen_t * inject_listener
uint32_t magic
char const * mode_name
char const * path
bool peercred
fr_ipaddr_t src_ipaddr
uid_t uid
char const * uid_name
char user[256]
struct fr_command_table_t

Definition at line 64 of file command.c.

+ Collaboration diagram for fr_command_table_t:
Data Fields
char const * command
fr_command_func_t func
char const * help
int mode
fr_command_table_t * table
struct fr_cs_buffer_t

Definition at line 74 of file command.c.

Data Fields
int auth
char buffer[COMMAND_BUFFER_SIZE]
int mode
ssize_t next
ssize_t offset

Macro Definition Documentation

#define CMD_FAIL   FR_CHANNEL_FAIL

Definition at line 61 of file command.c.

#define CMD_OK   FR_CHANNEL_SUCCESS

Definition at line 62 of file command.c.

#define COMMAND_BUFFER_SIZE   (1024)

Definition at line 72 of file command.c.

#define COMMAND_SOCKET_MAGIC   (0xffdeadee)

Definition at line 82 of file command.c.

#define FR_READ   (1)

Definition at line 58 of file command.c.

#define FR_WRITE   (2)

Definition at line 59 of file command.c.

#define MAX_ARGV   (16)

Definition at line 3273 of file command.c.

#define PU   "%u"

Definition at line 2478 of file command.c.

Typedef Documentation

typedef int(* fr_command_func_t)(rad_listen_t *, int, char *argv[])

Definition at line 56 of file command.c.

Definition at line 54 of file command.c.

Function Documentation

static ssize_t CC_HINT ( format(printf, 2, 3)  )
static

Definition at line 762 of file command.c.

+ Here is the call graph for this function:

static int command_add_client_file ( rad_listen_t listener,
int  argc,
char *  argv[] 
)
static

Definition at line 2803 of file command.c.

+ Here is the call graph for this function:

static void command_close_socket ( rad_listen_t this)
static

Definition at line 699 of file command.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int command_debug_condition ( rad_listen_t listener,
int  argc,
char *  argv[] 
)
static

Definition at line 1393 of file command.c.

+ Here is the call graph for this function:

static int command_debug_file ( rad_listen_t listener,
int  argc,
char *  argv[] 
)
static

Definition at line 1353 of file command.c.

+ Here is the call graph for this function:

static int command_debug_level ( rad_listen_t listener,
int  argc,
char *  argv[] 
)
static

Definition at line 1277 of file command.c.

static void command_debug_off ( void  )
static

Definition at line 713 of file command.c.

+ Here is the caller graph for this function:

static int command_del_client ( rad_listen_t listener,
int  argc,
char *  argv[] 
)
static

Definition at line 2831 of file command.c.

+ Here is the call graph for this function:

static int command_domain_accept ( rad_listen_t listener)
static

Definition at line 3513 of file command.c.

+ Here is the call graph for this function:

static int command_domain_recv ( rad_listen_t listener)
static

Definition at line 3506 of file command.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int command_domain_recv_co ( rad_listen_t listener,
fr_cs_buffer_t co 
)
static

Definition at line 3281 of file command.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int command_domain_send ( UNUSED rad_listen_t listener,
UNUSED REQUEST request 
)
static

Definition at line 3626 of file command.c.

static int command_hup ( rad_listen_t listener,
int  argc,
char *  argv[] 
)
static

Definition at line 804 of file command.c.

+ Here is the call graph for this function:

static int command_inject_file ( rad_listen_t listener,
int  argc,
char *  argv[] 
)
static

Definition at line 2025 of file command.c.

+ Here is the call graph for this function:

static int command_inject_from ( rad_listen_t listener,
int  argc,
char *  argv[] 
)
static

Definition at line 1992 of file command.c.

+ Here is the call graph for this function:

static int command_inject_to ( rad_listen_t listener,
int  argc,
char *  argv[] 
)
static

Definition at line 1973 of file command.c.

+ Here is the call graph for this function:

static int command_print_stats ( rad_listen_t listener,
fr_stats_t stats,
int  auth,
int  server 
)
static

Definition at line 2482 of file command.c.

+ Here is the caller graph for this function:

static int command_set_home_server_state ( rad_listen_t listener,
int  argc,
char *  argv[] 
)
static

Definition at line 1803 of file command.c.

+ Here is the call graph for this function:

static int command_set_module_config ( rad_listen_t listener,
int  argc,
char *  argv[] 
)
static

Definition at line 2332 of file command.c.

+ Here is the call graph for this function:

static int command_set_module_status ( rad_listen_t listener,
int  argc,
char *  argv[] 
)
static

Definition at line 2419 of file command.c.

+ Here is the call graph for this function:

static int command_show_clients ( rad_listen_t listener,
UNUSED int  argc,
UNUSED char *  argv[] 
)
static

Definition at line 1239 of file command.c.

+ Here is the call graph for this function:

static int command_show_config ( rad_listen_t listener,
int  argc,
char *  argv[] 
)
static

Definition at line 869 of file command.c.

+ Here is the call graph for this function:

static int command_show_debug_condition ( rad_listen_t listener,
UNUSED int  argc,
UNUSED char *  argv[] 
)
static

Definition at line 1633 of file command.c.

+ Here is the call graph for this function:

static int command_show_debug_file ( rad_listen_t listener,
UNUSED int  argc,
UNUSED char *  argv[] 
)
static

Definition at line 1650 of file command.c.

static int command_show_debug_level ( rad_listen_t listener,
UNUSED int  argc,
UNUSED char *  argv[] 
)
static

Definition at line 1660 of file command.c.

static int command_show_home_server_state ( rad_listen_t listener,
int  argc,
char *  argv[] 
)
static

Definition at line 1835 of file command.c.

+ Here is the call graph for this function:

static int command_show_home_servers ( rad_listen_t listener,
UNUSED int  argc,
UNUSED char *  argv[] 
)
static

Definition at line 1155 of file command.c.

+ Here is the call graph for this function:

static int command_show_module_config ( rad_listen_t listener,
int  argc,
char *  argv[] 
)
static

Definition at line 993 of file command.c.

+ Here is the call graph for this function:

static int command_show_module_flags ( rad_listen_t listener,
int  argc,
char *  argv[] 
)
static

Definition at line 1060 of file command.c.

+ Here is the call graph for this function:

static int command_show_module_methods ( rad_listen_t listener,
int  argc,
char *  argv[] 
)
static

Definition at line 1029 of file command.c.

+ Here is the call graph for this function:

static int command_show_module_status ( rad_listen_t listener,
int  argc,
char *  argv[] 
)
static

Definition at line 1091 of file command.c.

+ Here is the call graph for this function:

static int command_show_modules ( rad_listen_t listener,
UNUSED int  argc,
UNUSED char *  argv[] 
)
static

Definition at line 1124 of file command.c.

+ Here is the call graph for this function:

static int command_show_version ( rad_listen_t listener,
UNUSED int  argc,
UNUSED char *  argv[] 
)
static

Definition at line 1271 of file command.c.

static int command_socket_decode ( UNUSED rad_listen_t listener,
UNUSED REQUEST request 
)
static

Definition at line 3640 of file command.c.

static int command_socket_encode ( UNUSED rad_listen_t listener,
UNUSED REQUEST request 
)
static

Definition at line 3633 of file command.c.

static void command_socket_free ( rad_listen_t this)
static

Definition at line 3012 of file command.c.

static int command_socket_open ( CONF_SECTION cs,
rad_listen_t this 
)
static

Definition at line 3150 of file command.c.

+ Here is the call graph for this function:

static int command_socket_open_unix ( UNUSED CONF_SECTION cs,
rad_listen_t this 
)
static

Definition at line 3092 of file command.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int command_socket_parse ( CONF_SECTION cs,
rad_listen_t this 
)
static

Definition at line 3120 of file command.c.

+ Here is the call graph for this function:

static int command_socket_parse_unix ( CONF_SECTION cs,
rad_listen_t this 
)
static

Definition at line 3033 of file command.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int command_socket_print ( rad_listen_t const *  this,
char *  buffer,
size_t  bufsize 
)
static

Definition at line 3160 of file command.c.

+ Here is the call graph for this function:

static int command_stats_client ( rad_listen_t listener,
int  argc,
char *  argv[] 
)
static

Definition at line 2701 of file command.c.

+ Here is the call graph for this function:

static int command_stats_detail ( rad_listen_t listener,
int  argc,
char *  argv[] 
)
static

Definition at line 2595 of file command.c.

+ Here is the call graph for this function:

static int command_stats_home_server ( rad_listen_t listener,
int  argc,
char *  argv[] 
)
static

Definition at line 2651 of file command.c.

+ Here is the call graph for this function:

static int command_stats_memory ( rad_listen_t listener,
int  argc,
char *  argv[] 
)
static

Definition at line 2549 of file command.c.

+ Here is the call graph for this function:

static int command_stats_socket ( rad_listen_t listener,
int  argc,
char *  argv[] 
)
static

Definition at line 2787 of file command.c.

+ Here is the call graph for this function:

static int command_stats_state ( rad_listen_t listener,
UNUSED int  argc,
UNUSED char *  argv[] 
)
static

Definition at line 2519 of file command.c.

+ Here is the call graph for this function:

static int command_tcp_recv ( rad_listen_t this)
static

Definition at line 3462 of file command.c.

+ Here is the call graph for this function:

static int command_tcp_send ( UNUSED rad_listen_t listener,
UNUSED REQUEST request 
)
static

Definition at line 3501 of file command.c.

static int command_terminate ( UNUSED rad_listen_t listener,
UNUSED int  argc,
UNUSED char *  argv[] 
)
static

Definition at line 850 of file command.c.

+ Here is the call graph for this function:

static int command_uptime ( rad_listen_t listener,
UNUSED int  argc,
UNUSED char *  argv[] 
)
static

Definition at line 858 of file command.c.

static int command_write_magic ( int  newfd,
listen_socket_t sock 
)
static

Definition at line 3415 of file command.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void cprint_conf_parser ( rad_listen_t listener,
int  indent,
CONF_SECTION cs,
void const *  base 
)
static

Definition at line 899 of file command.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int dict_str_to_argvX ( char *  str,
char **  argv,
int  max_argc 
)
static

Definition at line 3177 of file command.c.

+ Here is the caller graph for this function:

static int fr_server_domain_socket_peercred ( char const *  path,
uid_t UNUSED  uid,
UNUSED gid_t  gid 
)
static

Initialise a socket for use with peercred authentication.

This function initialises a socket and path in a way suitable for use with peercred.

Parameters
pathto socket.
uidthat should own the socket (linux only).
gidthat should own the socket (linux only).
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 164 of file command.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int fr_server_domain_socket_perm ( UNUSED char const *  path,
UNUSED uid_t  uid,
UNUSED gid_t  gid 
)
static

Definition at line 327 of file command.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static RADCLIENT* get_client ( rad_listen_t listener,
int  argc,
char *  argv[] 
)
static

Definition at line 1669 of file command.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static home_server_t* get_home_server ( rad_listen_t listener,
int  argc,
char *  argv[],
int *  last 
)
static

Definition at line 1747 of file command.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static rad_listen_t* get_socket ( rad_listen_t listener,
int  argc,
char *  argv[],
int *  last 
)
static

Definition at line 1928 of file command.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int null_socket_dencode ( UNUSED rad_listen_t listener,
UNUSED REQUEST request 
)
static

Definition at line 1871 of file command.c.

+ Here is the caller graph for this function:

static int null_socket_send ( UNUSED rad_listen_t listener,
REQUEST request 
)
static

Definition at line 1876 of file command.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void print_help ( rad_listen_t listener,
int  argc,
char *  argv[],
fr_command_table_t table,
int  recursive 
)
static

Definition at line 3235 of file command.c.

+ Here is the caller graph for this function:

Variable Documentation

const CONF_PARSER command_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET("socket", PW_TYPE_STRING, fr_command_socket_t, path), .dflt = "${run_dir}/radiusd.sock" },
{ FR_CONF_OFFSET("peercred", PW_TYPE_BOOLEAN, fr_command_socket_t, peercred), .dflt = "yes" },
}
#define CONF_PARSER_TERMINATOR
Definition: conffile.h:289
A truth value.
Definition: radius.h:56
#define FR_CONF_OFFSET(_n, _t, _s, _f)
Definition: conffile.h:168
String of printable characters.
Definition: radius.h:33

Definition at line 108 of file command.c.

fr_command_table_t command_table[]
static

Definition at line 2974 of file command.c.

fr_command_table_t command_table_add[]
static
Initial value:
= {
{ "client", FR_WRITE,
"add client <command> - Add client configuration commands",
{ NULL, 0, NULL, NULL, NULL }
}
#define FR_WRITE
Definition: command.c:59
static fr_command_table_t command_table_add_client[]
Definition: command.c:2875

Definition at line 2884 of file command.c.

fr_command_table_t command_table_add_client[]
static
Initial value:
= {
{ "file", FR_WRITE,
"add client file <filename> - Add new client definition from <filename>",
{ NULL, 0, NULL, NULL, NULL }
}
#define FR_WRITE
Definition: command.c:59
static int command_add_client_file(rad_listen_t *listener, int argc, char *argv[])
Definition: command.c:2803

Definition at line 2875 of file command.c.

fr_command_table_t command_table_debug[]
static
Initial value:
= {
{ "condition", FR_WRITE,
"debug condition [condition] - Enable debugging for requests matching [condition]",
{ "level", FR_WRITE,
"debug level <number> - Set debug level to <number>. Higher is more debugging.",
{ "file", FR_WRITE,
"debug file [filename] - Send all debugging output to [filename]",
{ NULL, 0, NULL, NULL, NULL }
}
static int command_debug_file(rad_listen_t *listener, int argc, char *argv[])
Definition: command.c:1353
#define FR_WRITE
Definition: command.c:59
static int command_debug_level(rad_listen_t *listener, int argc, char *argv[])
Definition: command.c:1277
static int command_debug_condition(rad_listen_t *listener, int argc, char *argv[])
Definition: command.c:1393

Definition at line 2164 of file command.c.

fr_command_table_t command_table_del[]
static
Initial value:
= {
{ "client", FR_WRITE,
"del client <command> - Delete client configuration commands",
{ NULL, 0, NULL, NULL, NULL }
}
#define FR_WRITE
Definition: command.c:59
static fr_command_table_t command_table_del_client[]
Definition: command.c:2857

Definition at line 2866 of file command.c.

fr_command_table_t command_table_del_client[]
static
Initial value:
= {
{ "ipaddr", FR_WRITE,
"del client ipaddr <ipaddr> [udp|tcp] [listen <ipaddr> <port>] - Delete a dynamically created client",
{ NULL, 0, NULL, NULL, NULL }
}
#define FR_WRITE
Definition: command.c:59
static int command_del_client(rad_listen_t *listener, int argc, char *argv[])
Definition: command.c:2831

Definition at line 2857 of file command.c.

fr_command_table_t command_table_inject[]
static
Initial value:
= {
{ "to", FR_WRITE,
"inject to <ipaddr> <port> - Inject packets to the destination IP and port.",
{ "from", FR_WRITE,
"inject from <ipaddr> - Inject packets as if they came from <ipaddr>",
{ "file", FR_WRITE,
"inject file <input-file> <output-file> - Inject packet from <input-file>, with results sent to <output-file>",
{ NULL, 0, NULL, NULL, NULL }
}
#define FR_WRITE
Definition: command.c:59
static int command_inject_file(rad_listen_t *listener, int argc, char *argv[])
Definition: command.c:2025
static int command_inject_to(rad_listen_t *listener, int argc, char *argv[])
Definition: command.c:1973
static int command_inject_from(rad_listen_t *listener, int argc, char *argv[])
Definition: command.c:1992

Definition at line 2148 of file command.c.

fr_command_table_t command_table_set[]
static
Initial value:
= {
{ "module", FR_WRITE,
"set module <command> - set module commands",
{ "home_server", FR_WRITE,
"set home_server <command> - set home server commands",
{ NULL, 0, NULL, NULL, NULL }
}
static fr_command_table_t command_table_set_home[]
Definition: command.c:2894
#define FR_WRITE
Definition: command.c:59
static fr_command_table_t command_table_set_module[]
Definition: command.c:2903

Definition at line 2916 of file command.c.

fr_command_table_t command_table_set_home[]
static
Initial value:
= {
{ "state", FR_WRITE,
"set home_server state <ipaddr> <port> [udp|tcp] [alive|dead] - set state for given home server",
{ NULL, 0, NULL, NULL, NULL }
}
static int command_set_home_server_state(rad_listen_t *listener, int argc, char *argv[])
Definition: command.c:1803
#define FR_WRITE
Definition: command.c:59

Definition at line 2894 of file command.c.

fr_command_table_t command_table_set_module[]
static
Initial value:
= {
{ "config", FR_WRITE,
"set module config <module> variable value - set configuration for <module>",
{ "status", FR_WRITE,
"set module status <module> [alive|...] - set the module status to be alive (operating normally), or force a particular code (ok,fail, etc.)",
{ NULL, 0, NULL, NULL, NULL }
}
#define FR_WRITE
Definition: command.c:59
static int command_set_module_config(rad_listen_t *listener, int argc, char *argv[])
Definition: command.c:2332
static int command_set_module_status(rad_listen_t *listener, int argc, char *argv[])
Definition: command.c:2419

Definition at line 2903 of file command.c.

fr_command_table_t command_table_show[]
static

Definition at line 2298 of file command.c.

fr_command_table_t command_table_show_client[]
static
Initial value:
= {
{ "list", FR_READ,
"show client list - shows list of global clients",
{ NULL, 0, NULL, NULL, NULL }
}
static int command_show_clients(rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[])
Definition: command.c:1239
#define FR_READ
Definition: command.c:58

Definition at line 2247 of file command.c.

fr_command_table_t command_table_show_debug[]
static
Initial value:
= {
{ "condition", FR_READ,
"show debug condition - Shows current debugging condition.",
{ "level", FR_READ,
"show debug level - Shows current debugging level.",
{ "file", FR_READ,
"show debug file - Shows current debugging file.",
{ NULL, 0, NULL, NULL, NULL }
}
static int command_show_debug_condition(rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[])
Definition: command.c:1633
static int command_show_debug_file(rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[])
Definition: command.c:1650
#define FR_READ
Definition: command.c:58
static int command_show_debug_level(rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[])
Definition: command.c:1660

Definition at line 2211 of file command.c.

fr_command_table_t command_table_show_home[]
static
Initial value:
= {
{ "list", FR_READ,
"show home_server list - shows list of home servers",
{ "state", FR_READ,
"show home_server state <ipaddr> <port> [udp|tcp] - shows state of given home server",
{ NULL, 0, NULL, NULL, NULL }
}
static int command_show_home_servers(rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[])
Definition: command.c:1155
static int command_show_home_server_state(rad_listen_t *listener, int argc, char *argv[])
Definition: command.c:1835
#define FR_READ
Definition: command.c:58

Definition at line 2256 of file command.c.

fr_command_table_t command_table_show_module[]
static
Initial value:
= {
{ "config", FR_READ,
"show module config <module> - show configuration for given module",
{ "flags", FR_READ,
"show module flags <module> - show other module properties",
{ "list", FR_READ,
"show module list - shows list of loaded modules",
{ "methods", FR_READ,
"show module methods <module> - show sections where <module> may be used",
{ "status", FR_READ,
"show module status <module> - show the module status",
{ NULL, 0, NULL, NULL, NULL }
}
static int command_show_module_status(rad_listen_t *listener, int argc, char *argv[])
Definition: command.c:1091
static int command_show_module_flags(rad_listen_t *listener, int argc, char *argv[])
Definition: command.c:1060
static int command_show_modules(rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[])
Definition: command.c:1124
static int command_show_module_config(rad_listen_t *listener, int argc, char *argv[])
Definition: command.c:993
static int command_show_module_methods(rad_listen_t *listener, int argc, char *argv[])
Definition: command.c:1029
#define FR_READ
Definition: command.c:58

Definition at line 2227 of file command.c.

fr_command_table_t command_table_stats[]
static

Definition at line 2931 of file command.c.

fr_cond_t * debug_condition = NULL

Condition used to mark packets up for checking.

Definition at line 48 of file mainconfig.c.

fr_log_t debug_log = { .fd = -1, .dst = L_DST_NULL }

Definition at line 49 of file mainconfig.c.

char debug_log_file_buffer[1024]
static

Definition at line 125 of file command.c.

char const* elapsed_names[8]
static
Initial value:
= {
"1us", "10us", "100us", "1ms", "10ms", "100ms", "1s", "10s"
}

Definition at line 2463 of file command.c.

char const* method_names[MOD_COUNT]
static
Initial value:
= {
"authenticate",
"authorize",
"preacct",
"accounting",
"session",
"pre-proxy",
"post-proxy",
"post-auth"
}

Definition at line 1017 of file command.c.

FR_NAME_NUMBER mode_names[]
static
Initial value:
= {
{ "ro", FR_READ },
{ "read-only", FR_READ },
{ "read-write", FR_READ | FR_WRITE },
{ "rw", FR_READ | FR_WRITE },
{ NULL, 0 }
}
#define FR_WRITE
Definition: command.c:59
#define FR_READ
Definition: command.c:58

Definition at line 117 of file command.c.

FR_NAME_NUMBER state_names[]
static
Initial value:
= {
{ "unopened", STATE_UNOPENED },
{ "unlocked", STATE_UNLOCKED },
{ "header", STATE_HEADER },
{ "reading", STATE_READING },
{ "queued", STATE_QUEUED },
{ "running", STATE_RUNNING },
{ "no-reply", STATE_NO_REPLY },
{ "replied", STATE_REPLIED },
{ NULL, 0 }
}

Definition at line 2582 of file command.c.

char const tabs[] = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"
static

Definition at line 894 of file command.c.