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

Tracks sessions. More...

#include <freeradius-devel/server/base.h>
#include <freeradius-devel/server/radutmp.h>
#include <freeradius-devel/server/module_rlm.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/radius/radius.h>
#include <fcntl.h>
#include "config.h"
+ Include dependency graph for rlm_radutmp.c:

Go to the source code of this file.

Data Structures

struct  nas_port_s
 
struct  rlm_radutmp_env_t
 
struct  rlm_radutmp_mutable_t
 
struct  rlm_radutmp_t
 

Macros

#define LOCK_LEN   sizeof(struct radutmp)
 

Typedefs

typedef struct nas_port_s NAS_PORT
 

Functions

static unlang_action_t mod_accounting (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
 
static int mod_detach (module_detach_ctx_t const *mctx)
 
static int mod_instantiate (module_inst_ctx_t const *mctx)
 
static NAS_PORTnas_port_find (NAS_PORT *nas_port_list, uint32_t nasaddr, uint16_t port)
 
static unlang_action_t radutmp_zap (rlm_rcode_t *p_result, request_t *request, char const *filename, uint32_t nasaddr, time_t t)
 

Variables

static fr_dict_attr_t const * attr_acct_delay_time
 
static fr_dict_attr_t const * attr_acct_session_id
 
static fr_dict_attr_t const * attr_acct_session_time
 
static fr_dict_attr_t const * attr_acct_status_type
 
static fr_dict_attr_t const * attr_calling_station_id
 
static fr_dict_attr_t const * attr_framed_ip_address
 
static fr_dict_attr_t const * attr_framed_protocol
 
static fr_dict_attr_t const * attr_login_ip_host
 
static fr_dict_attr_t const * attr_nas_ip_address
 
static fr_dict_attr_t const * attr_nas_port
 
static fr_dict_attr_t const * attr_nas_port_type
 
static fr_dict_t const * dict_radius
 
static const call_env_method_t method_env
 
static const conf_parser_t module_config []
 
static char const porttypes [] = "ASITX"
 
module_rlm_t rlm_radutmp
 
fr_dict_autoload_t rlm_radutmp_dict []
 
fr_dict_attr_autoload_t rlm_radutmp_dict_attr []
 

Detailed Description

Tracks sessions.

Id
0b05b0049344d6f9bf4ae6138b25cf3a227c90df

Definition in file rlm_radutmp.c.


Data Structure Documentation

◆ nas_port_s

struct nas_port_s

Definition at line 44 of file rlm_radutmp.c.

+ Collaboration diagram for nas_port_s:
Data Fields
uint32_t nasaddr
NAS_PORT * next
off_t offset
uint16_t port

◆ rlm_radutmp_env_t

struct rlm_radutmp_env_t

Definition at line 62 of file rlm_radutmp.c.

+ Collaboration diagram for rlm_radutmp_env_t:
Data Fields
fr_value_box_t filename
fr_value_box_t username

◆ rlm_radutmp_mutable_t

struct rlm_radutmp_mutable_t

Definition at line 51 of file rlm_radutmp.c.

+ Collaboration diagram for rlm_radutmp_mutable_t:
Data Fields
NAS_PORT * nas_port_list

◆ rlm_radutmp_t

struct rlm_radutmp_t

Definition at line 55 of file rlm_radutmp.c.

+ Collaboration diagram for rlm_radutmp_t:
Data Fields
bool caller_id_ok
bool check_nas
rlm_radutmp_mutable_t * mutable
uint32_t permission

Macro Definition Documentation

◆ LOCK_LEN

#define LOCK_LEN   sizeof(struct radutmp)

Definition at line 36 of file rlm_radutmp.c.

Typedef Documentation

◆ NAS_PORT

typedef struct nas_port_s NAS_PORT

Definition at line 38 of file rlm_radutmp.c.

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 194 of file rlm_radutmp.c.

+ Here is the call graph for this function:

◆ mod_detach()

static int mod_detach ( module_detach_ctx_t const *  mctx)
static

Definition at line 568 of file rlm_radutmp.c.

+ Here is the call graph for this function:

◆ mod_instantiate()

static int mod_instantiate ( module_inst_ctx_t const *  mctx)
static

Definition at line 555 of file rlm_radutmp.c.

◆ nas_port_find()

static NAS_PORT* nas_port_find ( NAS_PORT nas_port_list,
uint32_t  nasaddr,
uint16_t  port 
)
static

Definition at line 177 of file rlm_radutmp.c.

+ Here is the caller graph for this function:

◆ radutmp_zap()

static unlang_action_t radutmp_zap ( rlm_rcode_t p_result,
request_t request,
char const *  filename,
uint32_t  nasaddr,
time_t  t 
)
static

Definition at line 123 of file rlm_radutmp.c.

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

Variable Documentation

◆ attr_acct_delay_time

fr_dict_attr_t const* attr_acct_delay_time
static

Definition at line 92 of file rlm_radutmp.c.

◆ attr_acct_session_id

fr_dict_attr_t const* attr_acct_session_id
static

Definition at line 93 of file rlm_radutmp.c.

◆ attr_acct_session_time

fr_dict_attr_t const* attr_acct_session_time
static

Definition at line 94 of file rlm_radutmp.c.

◆ attr_acct_status_type

fr_dict_attr_t const* attr_acct_status_type
static

Definition at line 95 of file rlm_radutmp.c.

◆ attr_calling_station_id

fr_dict_attr_t const* attr_calling_station_id
static

Definition at line 96 of file rlm_radutmp.c.

◆ attr_framed_ip_address

fr_dict_attr_t const* attr_framed_ip_address
static

Definition at line 97 of file rlm_radutmp.c.

◆ attr_framed_protocol

fr_dict_attr_t const* attr_framed_protocol
static

Definition at line 98 of file rlm_radutmp.c.

◆ attr_login_ip_host

fr_dict_attr_t const* attr_login_ip_host
static

Definition at line 99 of file rlm_radutmp.c.

◆ attr_nas_ip_address

fr_dict_attr_t const* attr_nas_ip_address
static

Definition at line 100 of file rlm_radutmp.c.

◆ attr_nas_port

fr_dict_attr_t const* attr_nas_port
static

Definition at line 101 of file rlm_radutmp.c.

◆ attr_nas_port_type

fr_dict_attr_t const* attr_nas_port_type
static

Definition at line 102 of file rlm_radutmp.c.

◆ dict_radius

fr_dict_t const* dict_radius
static

Definition at line 84 of file rlm_radutmp.c.

◆ method_env

const call_env_method_t method_env
static
Initial value:
= {
.env = (call_env_parser_t[]) {
.pair.dflt = "%{User-Name}", .pair.dflt_quote = T_DOUBLE_QUOTED_STRING },
}
}
#define CALL_ENV_TERMINATOR
Definition: call_env.h:231
#define FR_CALL_ENV_METHOD_OUT(_inst)
Helper macro for populating the size/type fields of a call_env_method_t from the output structure typ...
Definition: call_env.h:235
@ CALL_ENV_FLAG_REQUIRED
Associated conf pair or section is required.
Definition: call_env.h:75
#define FR_CALL_ENV_OFFSET(_name, _cast_type, _flags, _struct, _field)
Specify a call_env_parser_t which writes out runtime results to the specified field.
Definition: call_env.h:335
Per method call config.
Definition: call_env.h:175
@ FR_TYPE_STRING
String of printable characters.
Definition: merged_model.c:83
username
Definition: rlm_securid.c:420
@ T_DOUBLE_QUOTED_STRING
Definition: token.h:121

Definition at line 74 of file rlm_radutmp.c.

◆ module_config

const conf_parser_t module_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET("check_with_nas", rlm_radutmp_t, check_nas), .dflt = "yes" },
{ FR_CONF_OFFSET("permissions", rlm_radutmp_t, permission), .dflt = "0644" },
{ FR_CONF_OFFSET("caller_id", rlm_radutmp_t, caller_id_ok), .dflt = "no" },
}
#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

Definition at line 67 of file rlm_radutmp.c.

◆ porttypes

char const porttypes[] = "ASITX"
static

Definition at line 38 of file rlm_radutmp.c.

◆ rlm_radutmp

module_rlm_t rlm_radutmp
Initial value:
= {
.common = {
.name = "radutmp",
.inst_size = sizeof(rlm_radutmp_t),
.detach = mod_detach
},
.method_group = {
.bindings = (module_method_binding_t[]){
{ .section = SECTION_NAME("accounting", CF_IDENT_ANY), .method = mod_accounting, .method_env = &method_env },
}
}
}
#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_detach(module_detach_ctx_t const *mctx)
Definition: rlm_radutmp.c:568
static const call_env_method_t method_env
Definition: rlm_radutmp.c:74
static unlang_action_t mod_accounting(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
Definition: rlm_radutmp.c:194
static const conf_parser_t module_config[]
Definition: rlm_radutmp.c:67
static int mod_instantiate(module_inst_ctx_t const *mctx)
Definition: rlm_radutmp.c:555
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
@ MODULE_TYPE_THREAD_UNSAFE
Module is not threadsafe.
Definition: module.h:48
#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 579 of file rlm_radutmp.c.

◆ rlm_radutmp_dict

fr_dict_autoload_t rlm_radutmp_dict
Initial value:
= {
{ .out = &dict_radius, .proto = "radius" },
{ NULL }
}
static fr_dict_t const * dict_radius
Definition: rlm_radutmp.c:84

Definition at line 87 of file rlm_radutmp.c.

◆ rlm_radutmp_dict_attr

fr_dict_attr_autoload_t rlm_radutmp_dict_attr
Initial value:
= {
{ .out = &attr_acct_delay_time, .name = "Acct-Delay-Time", .type = FR_TYPE_UINT32, .dict = &dict_radius },
{ .out = &attr_acct_session_id, .name = "Acct-Session-Id", .type = FR_TYPE_STRING, .dict = &dict_radius },
{ .out = &attr_acct_session_time, .name = "Acct-Session-Time", .type = FR_TYPE_UINT32, .dict = &dict_radius },
{ .out = &attr_acct_status_type, .name = "Acct-Status-Type", .type = FR_TYPE_UINT32, .dict = &dict_radius },
{ .out = &attr_calling_station_id, .name = "Calling-Station-Id", .type = FR_TYPE_STRING, .dict = &dict_radius },
{ .out = &attr_framed_ip_address, .name = "Framed-IP-Address", .type = FR_TYPE_IPV4_ADDR, .dict = &dict_radius },
{ .out = &attr_framed_protocol, .name = "Framed-Protocol", .type = FR_TYPE_UINT32, .dict = &dict_radius },
{ .out = &attr_login_ip_host, .name = "Login-IP-Host", .type = FR_TYPE_IPV4_ADDR, .dict = &dict_radius },
{ .out = &attr_nas_ip_address, .name = "NAS-IP-Address", .type = FR_TYPE_IPV4_ADDR, .dict = &dict_radius },
{ .out = &attr_nas_port, .name = "NAS-Port", .type = FR_TYPE_UINT32, .dict = &dict_radius },
{ .out = &attr_nas_port_type, .name = "NAS-Port-Type", .type = FR_TYPE_UINT32, .dict = &dict_radius },
{ NULL }
}
@ FR_TYPE_IPV4_ADDR
32 Bit IPv4 Address.
Definition: merged_model.c:86
@ FR_TYPE_UINT32
32 Bit unsigned integer.
Definition: merged_model.c:99
static fr_dict_attr_t const * attr_login_ip_host
Definition: rlm_radutmp.c:99
static fr_dict_attr_t const * attr_acct_session_time
Definition: rlm_radutmp.c:94
static fr_dict_attr_t const * attr_nas_port_type
Definition: rlm_radutmp.c:102
static fr_dict_attr_t const * attr_calling_station_id
Definition: rlm_radutmp.c:96
static fr_dict_attr_t const * attr_nas_ip_address
Definition: rlm_radutmp.c:100
static fr_dict_attr_t const * attr_framed_ip_address
Definition: rlm_radutmp.c:97
static fr_dict_attr_t const * attr_framed_protocol
Definition: rlm_radutmp.c:98
static fr_dict_attr_t const * attr_nas_port
Definition: rlm_radutmp.c:101
static fr_dict_attr_t const * attr_acct_status_type
Definition: rlm_radutmp.c:95
static fr_dict_attr_t const * attr_acct_delay_time
Definition: rlm_radutmp.c:92
static fr_dict_attr_t const * attr_acct_session_id
Definition: rlm_radutmp.c:93

Definition at line 105 of file rlm_radutmp.c.