The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/server/exfile.h>
#include <freeradius-devel/server/module_rlm.h>
#include <freeradius-devel/server/tmpl_dcursor.h>
#include <freeradius-devel/server/rcode.h>
#include <freeradius-devel/server/tmpl.h>
#include <freeradius-devel/unlang/call_env.h>
#include <freeradius-devel/unlang/tmpl.h>
#include <freeradius-devel/unlang/module.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/util/iovec.h>
#include <freeradius-devel/util/perm.h>
#include <freeradius-devel/util/print.h>
#include <freeradius-devel/util/value.h>
#include <freeradius-devel/util/types.h>
#include <freeradius-devel/unlang/xlat_func.h>
#include <sys/uio.h>
Go to the source code of this file.
Data Structures | |
struct | linelog_call_env_t |
struct | linelog_conn_t |
struct | linelog_net_t |
struct | rlm_linelog_rctx_t |
struct | rlm_linelog_t |
linelog module instance More... | |
struct | rlm_linelog_t.file |
struct | rlm_linelog_t.syslog |
struct | rlm_linelog_t.unix_sock |
Macros | |
#define | VECTOR_INCREMENT 20 |
Enumerations | |
enum | linefr_log_dst_t { LINELOG_DST_INVALID = 0 , LINELOG_DST_FILE , LINELOG_DST_REQUEST , LINELOG_DST_SYSLOG , LINELOG_DST_UNIX , LINELOG_DST_UDP , LINELOG_DST_TCP , LINELOG_DST_STDOUT , LINELOG_DST_STDERR } |
Functions | |
static int | _mod_conn_free (linelog_conn_t *conn) |
static int | call_env_filename_parse (TALLOC_CTX *ctx, void *out, tmpl_rules_t const *t_rules, CONF_ITEM *ci, UNUSED char const *section_name1, UNUSED char const *section_name2, void const *data, UNUSED call_env_parser_t const *rule) |
static int | linelog_escape_func (fr_value_box_t *vb, UNUSED void *uctx) |
Escape unprintable characters. More... | |
static void | linelog_hexdump (request_t *request, struct iovec *vector_p, size_t vector_len, char const *msg) |
static int | linelog_write (rlm_linelog_t const *inst, linelog_call_env_t const *call_env, request_t *request, struct iovec *vector_p, size_t vector_len, bool with_delim) |
static xlat_action_t | linelog_xlat (TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *args) |
static int | mod_bootstrap (module_inst_ctx_t const *mctx) |
static void * | mod_conn_create (TALLOC_CTX *ctx, void *instance, fr_time_delta_t timeout) |
static int | mod_detach (module_detach_ctx_t const *mctx) |
static unlang_action_t | mod_do_linelog (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request) |
Write a linelog message. More... | |
static unlang_action_t | mod_do_linelog_resume (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request) |
static int | mod_instantiate (module_inst_ctx_t const *mctx) |
Variables | |
static const conf_parser_t | file_config [] |
static fr_table_num_sorted_t const | linefr_log_dst_table [] |
static size_t | linefr_log_dst_table_len = NUM_ELEMENTS(linefr_log_dst_table) |
static const call_env_method_t | linelog_method_env |
static const call_env_method_t | linelog_xlat_method_env |
static const conf_parser_t | module_config [] |
module_rlm_t | rlm_linelog |
static const conf_parser_t | syslog_config [] |
static const conf_parser_t | tcp_config [] |
static const conf_parser_t | udp_config [] |
static const conf_parser_t | unix_config [] |
struct linelog_call_env_t |
Definition at line 200 of file rlm_linelog.c.
Data Fields | ||
---|---|---|
fr_value_box_t * | filename | File name, if output is to a file. |
fr_value_box_t * | log_head | Header to add to each new log file. |
fr_value_box_t * | log_ref | Path to a CONF_PAIR (to use as the source of log messages). |
tmpl_t * | log_src | Source of log messages. |
struct linelog_conn_t |
Definition at line 138 of file rlm_linelog.c.
Data Fields | ||
---|---|---|
int | sockfd | File descriptor associated with socket. |
struct linelog_net_t |
Definition at line 95 of file rlm_linelog.c.
Data Fields | ||
---|---|---|
fr_ipaddr_t | dst_ipaddr | Network server. |
uint16_t | port | Network port. |
fr_ipaddr_t | src_ipaddr | Send requests from a given src_ipaddr. |
fr_time_delta_t | timeout | How long to wait for read/write operations. |
struct rlm_linelog_rctx_t |
Definition at line 606 of file rlm_linelog.c.
Data Fields | ||
---|---|---|
fr_value_box_list_t | expanded | The result of expanding the fmt tmpl. |
bool | with_delim | Whether to add a delimiter. |
struct rlm_linelog_t |
linelog module instance
Definition at line 104 of file rlm_linelog.c.
Data Fields | ||
---|---|---|
CONF_SECTION * | cs | CONF_SECTION to use as the root for #log_ref lookups. |
char const * | delimiter |
Line termination string (usually ). |
size_t | delimiter_len | Length of line termination string. |
struct rlm_linelog_t | file | |
linefr_log_dst_t | log_dst | Logging destination. |
char const * | log_dst_str | Logging destination string. |
fr_pool_t * | pool | Connection pool instance. |
struct rlm_linelog_t | syslog | |
linelog_net_t | tcp | TCP server. |
linelog_net_t | udp | UDP server. |
struct rlm_linelog_t | unix_sock |
struct rlm_linelog_t.file |
Definition at line 119 of file rlm_linelog.c.
Data Fields | ||
---|---|---|
exfile_t * | ef | Exclusive file access handle. |
bool | escape | Do filename escaping, yes / no. |
gid_t | group | Resolved gid. |
char const * | group_str | Group to set on new files. |
uint32_t | permissions | Permissions to use when creating new files. |
struct rlm_linelog_t.syslog |
Definition at line 113 of file rlm_linelog.c.
Data Fields | ||
---|---|---|
char const * | facility | Syslog facility string. |
int | priority | Bitwise | of severity and facility. |
char const * | severity | Syslog severity string. |
struct rlm_linelog_t.unix_sock |
Definition at line 127 of file rlm_linelog.c.
Data Fields | ||
---|---|---|
char const * | path | Where the UNIX socket lives. |
fr_time_delta_t | timeout | How long to wait for read/write operations. |
#define VECTOR_INCREMENT 20 |
enum linefr_log_dst_t |
Definition at line 70 of file rlm_linelog.c.
|
static |
Definition at line 241 of file rlm_linelog.c.
|
static |
|
static |
Escape unprintable characters.
\\n
.\\r
.\<oct><oct><oct>.
vb | Value box to escape. |
uctx | unused. |
Definition at line 340 of file rlm_linelog.c.
|
static |
Definition at line 352 of file rlm_linelog.c.
|
static |
Definition at line 362 of file rlm_linelog.c.
|
static |
Definition at line 570 of file rlm_linelog.c.
|
static |
|
static |
Definition at line 249 of file rlm_linelog.c.
|
static |
|
static |
Write a linelog message.
Write a log message to syslog or a flat file.
[in] | p_result | the result of the module call:
|
[in] | mctx | module calling context. |
[in] | request | The current request. |
Definition at line 678 of file rlm_linelog.c.
|
static |
Definition at line 611 of file rlm_linelog.c.
|
static |
|
static |
Definition at line 143 of file rlm_linelog.c.
|
static |
Definition at line 82 of file rlm_linelog.c.
|
static |
Definition at line 93 of file rlm_linelog.c.
|
static |
Definition at line 211 of file rlm_linelog.c.
|
static |
Definition at line 227 of file rlm_linelog.c.
|
static |
Definition at line 175 of file rlm_linelog.c.
module_rlm_t rlm_linelog |
Definition at line 1055 of file rlm_linelog.c.
|
static |
Definition at line 150 of file rlm_linelog.c.
|
static |
Definition at line 168 of file rlm_linelog.c.
|
static |
Definition at line 161 of file rlm_linelog.c.
|
static |
Definition at line 156 of file rlm_linelog.c.