The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Functions | Variables
rlm_rediswho.c File Reference

Session tracking using redis. More...

#include <freeradius-devel/server/base.h>
#include <freeradius-devel/server/module_rlm.h>
#include <freeradius-devel/server/modpriv.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/redis/base.h>
#include <freeradius-devel/redis/cluster.h>
+ Include dependency graph for rlm_rediswho.c:

Go to the source code of this file.

Data Structures

struct  rlm_rediswho_t
 

Functions

static unlang_action_t mod_accounting (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
 
static unlang_action_t mod_accounting_all (rlm_rcode_t *p_result, rlm_rediswho_t const *inst, request_t *request, char const *insert, char const *trim, char const *expire)
 
static int mod_instantiate (module_inst_ctx_t const *mctx)
 
static int mod_load (void)
 
static int rediswho_command (rlm_rediswho_t const *inst, request_t *request, char const *fmt)
 

Variables

static fr_dict_attr_t const * attr_acct_status_type
 
static fr_dict_t const * dict_radius
 
static conf_parser_t module_config []
 
module_rlm_t rlm_rediswho
 
fr_dict_autoload_t rlm_rediswho_dict []
 
fr_dict_attr_autoload_t rlm_rediswho_dict_attr []
 
static conf_parser_t section_config []
 

Detailed Description

Session tracking using redis.

Id
1c8a9200957305b9d3be94ddf8a30077c6fad248
Author
Gabriel Blanchard

Definition in file rlm_rediswho.c.


Data Structure Documentation

◆ rlm_rediswho_t

struct rlm_rediswho_t

Definition at line 39 of file rlm_rediswho.c.

+ Collaboration diagram for rlm_rediswho_t:
Data Fields
fr_redis_cluster_t * cluster Pool O pools.
fr_redis_conf_t conf Connection parameters for the Redis server.

Must be first field in this struct.

char const * expire Command for expiring entries.
int expiry_time Expiry time in seconds if no updates are received for a user.
char const * insert Command for inserting session data.
char const * trim Command for trimming the session list.
int trim_count How many session updates to keep track of per user.

Function Documentation

◆ mod_accounting()

static unlang_action_t mod_accounting ( rlm_rcode_t p_result,
module_ctx_t const *  mctx,
request_t request 
)
static

Definition at line 197 of file rlm_rediswho.c.

+ Here is the call graph for this function:

◆ mod_accounting_all()

static unlang_action_t mod_accounting_all ( rlm_rcode_t p_result,
rlm_rediswho_t const *  inst,
request_t request,
char const *  insert,
char const *  trim,
char const *  expire 
)
static

Definition at line 178 of file rlm_rediswho.c.

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

◆ mod_instantiate()

static int mod_instantiate ( module_inst_ctx_t const *  mctx)
static

Definition at line 232 of file rlm_rediswho.c.

+ Here is the call graph for this function:

◆ mod_load()

static int mod_load ( void  )
static

Definition at line 243 of file rlm_rediswho.c.

+ Here is the call graph for this function:

◆ rediswho_command()

static int rediswho_command ( rlm_rediswho_t const *  inst,
request_t request,
char const *  fmt 
)
static

Definition at line 99 of file rlm_rediswho.c.

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

Variable Documentation

◆ attr_acct_status_type

fr_dict_attr_t const* attr_acct_status_type
static

Definition at line 88 of file rlm_rediswho.c.

◆ dict_radius

fr_dict_t const* dict_radius
static

Definition at line 80 of file rlm_rediswho.c.

◆ module_config

conf_parser_t module_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET("trim_count", rlm_rediswho_t, trim_count), .dflt = "-1" },
{ FR_CONF_POINTER("Start", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = section_config },
{ FR_CONF_POINTER("Interim-Update", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = section_config },
{ FR_CONF_POINTER("Stop", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = section_config },
{ FR_CONF_POINTER("Accounting-On", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = section_config },
{ FR_CONF_POINTER("Accounting-Off", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = section_config },
{ FR_CONF_POINTER("Failed", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = section_config },
}
#define CONF_PARSER_TERMINATOR
Definition: cf_parse.h:627
#define FR_CONF_OFFSET(_name, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
Definition: cf_parse.h:268
#define FR_CONF_POINTER(_name, _type, _flags, _res_p)
conf_parser_t which parses a single CONF_PAIR producing a single global result
Definition: cf_parse.h:310
@ CONF_FLAG_SUBSECTION
Instead of putting the information into a configuration structure, the configuration file routines MA...
Definition: cf_parse.h:399
#define REDIS_COMMON_CONFIG
Definition: base.h:133
static conf_parser_t section_config[]
Definition: rlm_rediswho.c:54

Definition at line 61 of file rlm_rediswho.c.

◆ rlm_rediswho

module_rlm_t rlm_rediswho
Initial value:
= {
.common = {
.name = "rediswho",
.inst_size = sizeof(rlm_rediswho_t),
.onload = mod_load,
},
.method_group = {
.bindings = (module_method_binding_t[]){
{ .section = SECTION_NAME("accounting", CF_IDENT_ANY), .method = mod_accounting },
}
}
}
#define CF_IDENT_ANY
Definition: cf_util.h:78
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
Definition: dl_module.h:63
static const conf_parser_t config[]
Definition: base.c:183
static int mod_load(void)
Definition: rlm_rediswho.c:243
static unlang_action_t mod_accounting(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
Definition: rlm_rediswho.c:197
static int mod_instantiate(module_inst_ctx_t const *mctx)
Definition: rlm_rediswho.c:232
static conf_parser_t module_config[]
Definition: rlm_rediswho.c:61
static int instantiate(module_inst_ctx_t const *mctx)
Definition: rlm_rest.c:1302
#define SECTION_NAME(_name1, _name2)
Define a section name consisting of a verb and a noun.
Definition: section.h:40
#define MODULE_BINDING_TERMINATOR
Terminate a module binding list.
Definition: module.h:151
Named methods exported by a module.
Definition: module.h:173

Definition at line 251 of file rlm_rediswho.c.

◆ rlm_rediswho_dict

fr_dict_autoload_t rlm_rediswho_dict
Initial value:
= {
{ .out = &dict_radius, .proto = "radius" },
{ NULL }
}
static fr_dict_t const * dict_radius
Definition: rlm_rediswho.c:80

Definition at line 83 of file rlm_rediswho.c.

◆ rlm_rediswho_dict_attr

fr_dict_attr_autoload_t rlm_rediswho_dict_attr
Initial value:
= {
{ .out = &attr_acct_status_type, .name = "Acct-Status-Type", .type = FR_TYPE_UINT32, .dict = &dict_radius },
{ NULL }
}
@ FR_TYPE_UINT32
32 Bit unsigned integer.
Definition: merged_model.c:99
static fr_dict_attr_t const * attr_acct_status_type
Definition: rlm_rediswho.c:88

Definition at line 91 of file rlm_rediswho.c.

◆ section_config

conf_parser_t section_config[]
static
Initial value:
= {
}
#define FR_CONF_OFFSET_FLAGS(_name, _flags, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
Definition: cf_parse.h:256
@ CONF_FLAG_REQUIRED
Error out if no matching CONF_PAIR is found, and no dflt value is set.
Definition: cf_parse.h:405
@ CONF_FLAG_XLAT
string will be dynamically expanded.
Definition: cf_parse.h:416

Definition at line 54 of file rlm_rediswho.c.