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

A RADIUS client library. More...

#include <freeradius-devel/io/application.h>
#include <freeradius-devel/server/modpriv.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/util/dlist.h>
#include "rlm_radius.h"
+ Include dependency graph for rlm_radius.c:

Go to the source code of this file.

Functions

static int mod_detach (module_detach_ctx_t const *mctx)
 
static int mod_instantiate (module_inst_ctx_t const *mctx)
 
static int mod_load (void)
 
static unlang_action_t mod_process (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
 Send packets outbound. More...
 
static void mod_radius_signal (module_ctx_t const *mctx, request_t *request, fr_signal_t action)
 
static void mod_unload (void)
 
static void radius_fixups (rlm_radius_t const *inst, request_t *request)
 Do any RADIUS-layer fixups for proxying. More...
 
static int status_check_type_parse (TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
 
static int status_check_type_parse (UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED conf_parser_t const *rule)
 Allow for Status-Server ping checks. More...
 
static int status_check_update_parse (TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
 
static int status_check_update_parse (TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED conf_parser_t const *rule)
 Allow the admin to set packet contents for Status-Server ping checks. More...
 
static int type_parse (TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
 
static int type_parse (UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED conf_parser_t const *rule)
 Set which types of packets we can parse. More...
 

Variables

static conf_parser_t acct_config []
 
static fr_dict_attr_t const * attr_chap_challenge
 
static fr_dict_attr_t const * attr_chap_password
 
static fr_dict_attr_t const * attr_packet_type
 
static fr_dict_attr_t const * attr_proxy_state
 
static conf_parser_t auth_config []
 
static conf_parser_t coa_config []
 
static fr_dict_t const * dict_radius
 
static conf_parser_t disconnect_config []
 
static conf_parser_t const module_config []
 
module_rlm_t rlm_radius
 
fr_dict_autoload_t rlm_radius_dict []
 
fr_dict_attr_autoload_t rlm_radius_dict_attr []
 
static conf_parser_t const status_check_config []
 
static conf_parser_t const status_check_update_config []
 
static conf_parser_t status_config []
 
static conf_parser_t const type_interval_config [FR_RADIUS_CODE_MAX]
 

Detailed Description

A RADIUS client library.

Id
81ed6af31508a99cfc37180f7fee41bf863d9260

Definition in file rlm_radius.c.

Function Documentation

◆ mod_detach()

static int mod_detach ( module_detach_ctx_t const *  mctx)
static

Definition at line 636 of file rlm_radius.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 460 of file rlm_radius.c.

+ Here is the call graph for this function:

◆ mod_load()

static int mod_load ( void  )
static

Definition at line 644 of file rlm_radius.c.

+ Here is the call graph for this function:

◆ mod_process()

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

Send packets outbound.

Definition at line 395 of file rlm_radius.c.

+ Here is the call graph for this function:

◆ mod_radius_signal()

static void mod_radius_signal ( module_ctx_t const *  mctx,
request_t request,
fr_signal_t  action 
)
static

Definition at line 338 of file rlm_radius.c.

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

◆ mod_unload()

static void mod_unload ( void  )
static

Definition at line 653 of file rlm_radius.c.

+ Here is the call graph for this function:

◆ radius_fixups()

static void radius_fixups ( rlm_radius_t const *  inst,
request_t request 
)
static

Do any RADIUS-layer fixups for proxying.

Definition at line 360 of file rlm_radius.c.

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

◆ status_check_type_parse() [1/2]

static int status_check_type_parse ( TALLOC_CTX *  ctx,
void *  out,
UNUSED void *  parent,
CONF_ITEM ci,
conf_parser_t const *  rule 
)
static

◆ status_check_type_parse() [2/2]

static int status_check_type_parse ( UNUSED TALLOC_CTX *  ctx,
void *  out,
UNUSED void *  parent,
CONF_ITEM ci,
UNUSED conf_parser_t const *  rule 
)
static

Allow for Status-Server ping checks.

Parameters
[in]ctxto allocate data in (instance of proto_radius).
[out]outWhere to write our parsed data.
[in]parentBase structure address.
[in]ciCONF_PAIR specifying the name of the type module.
[in]ruleunused.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 236 of file rlm_radius.c.

+ Here is the call graph for this function:

◆ status_check_update_parse() [1/2]

static int status_check_update_parse ( TALLOC_CTX *  ctx,
void *  out,
UNUSED void *  parent,
CONF_ITEM ci,
conf_parser_t const *  rule 
)
static

◆ status_check_update_parse() [2/2]

static int status_check_update_parse ( TALLOC_CTX *  ctx,
void *  out,
UNUSED void *  parent,
CONF_ITEM ci,
UNUSED conf_parser_t const *  rule 
)
static

Allow the admin to set packet contents for Status-Server ping checks.

Parameters
[in]ctxto allocate data in (instance of proto_radius).
[out]outWhere to write our parsed data
[in]parentBase structure address.
[in]ciCONF_SECTION specifying the things to update
[in]ruleunused.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 294 of file rlm_radius.c.

+ Here is the call graph for this function:

◆ type_parse() [1/2]

static int type_parse ( TALLOC_CTX *  ctx,
void *  out,
UNUSED void *  parent,
CONF_ITEM ci,
conf_parser_t const *  rule 
)
static

◆ type_parse() [2/2]

static int type_parse ( UNUSED TALLOC_CTX *  ctx,
void *  out,
UNUSED void *  parent,
CONF_ITEM ci,
UNUSED conf_parser_t const *  rule 
)
static

Set which types of packets we can parse.

Parameters
[in]ctxto allocate data in (instance of rlm_radius).
[out]outWhere to write the parsed data.
[in]parentBase structure address.
[in]ciCONF_PAIR specifying the name of the type module.
[in]ruleunused.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 176 of file rlm_radius.c.

+ Here is the call graph for this function:

Variable Documentation

◆ acct_config

conf_parser_t acct_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET("initial_rtx_time", rlm_radius_t, retry[FR_RADIUS_CODE_ACCOUNTING_REQUEST].irt), .dflt = STRINGIFY(2) },
{ FR_CONF_OFFSET("max_rtx_time", rlm_radius_t, retry[FR_RADIUS_CODE_ACCOUNTING_REQUEST].mrt), .dflt = STRINGIFY(5) },
{ FR_CONF_OFFSET("max_rtx_count", rlm_radius_t, retry[FR_RADIUS_CODE_ACCOUNTING_REQUEST].mrc), .dflt = STRINGIFY(1) },
{ FR_CONF_OFFSET("max_rtx_duration", rlm_radius_t, retry[FR_RADIUS_CODE_ACCOUNTING_REQUEST].mrd), .dflt = STRINGIFY(30) },
}
#define STRINGIFY(x)
Definition: build.h:195
#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
@ FR_RADIUS_CODE_ACCOUNTING_REQUEST
RFC2866 - Accounting-Request.
Definition: defs.h:36

Definition at line 65 of file rlm_radius.c.

◆ attr_chap_challenge

fr_dict_attr_t const* attr_chap_challenge
static

Definition at line 151 of file rlm_radius.c.

◆ attr_chap_password

fr_dict_attr_t const* attr_chap_password
static

Definition at line 152 of file rlm_radius.c.

◆ attr_packet_type

fr_dict_attr_t const* attr_packet_type
static

Definition at line 153 of file rlm_radius.c.

◆ attr_proxy_state

fr_dict_attr_t const* attr_proxy_state
static

Definition at line 154 of file rlm_radius.c.

◆ auth_config

conf_parser_t auth_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET("initial_rtx_time", rlm_radius_t, retry[FR_RADIUS_CODE_ACCESS_REQUEST].irt), .dflt = STRINGIFY(2) },
{ FR_CONF_OFFSET("max_rtx_time", rlm_radius_t, retry[FR_RADIUS_CODE_ACCESS_REQUEST].mrt), .dflt = STRINGIFY(16) },
{ FR_CONF_OFFSET("max_rtx_count", rlm_radius_t, retry[FR_RADIUS_CODE_ACCESS_REQUEST].mrc), .dflt = STRINGIFY(5) },
{ FR_CONF_OFFSET("max_rtx_duration", rlm_radius_t, retry[FR_RADIUS_CODE_ACCESS_REQUEST].mrd), .dflt = STRINGIFY(30) },
}
@ FR_RADIUS_CODE_ACCESS_REQUEST
RFC2865 - Access-Request.
Definition: defs.h:33

Definition at line 57 of file rlm_radius.c.

◆ coa_config

conf_parser_t coa_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET("initial_rtx_time", rlm_radius_t, retry[FR_RADIUS_CODE_COA_REQUEST].irt), .dflt = STRINGIFY(2) },
{ FR_CONF_OFFSET("max_rtx_time", rlm_radius_t, retry[FR_RADIUS_CODE_COA_REQUEST].mrt), .dflt = STRINGIFY(16) },
{ FR_CONF_OFFSET("max_rtx_count", rlm_radius_t, retry[FR_RADIUS_CODE_COA_REQUEST].mrc), .dflt = STRINGIFY(5) },
{ FR_CONF_OFFSET("max_rtx_duration", rlm_radius_t, retry[FR_RADIUS_CODE_COA_REQUEST].mrd), .dflt = STRINGIFY(30) },
}
@ FR_RADIUS_CODE_COA_REQUEST
RFC3575/RFC5176 - CoA-Request.
Definition: defs.h:49

Definition at line 81 of file rlm_radius.c.

◆ dict_radius

fr_dict_t const* dict_radius
static

Definition at line 143 of file rlm_radius.c.

◆ disconnect_config

conf_parser_t disconnect_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET("initial_rtx_time", rlm_radius_t, retry[FR_RADIUS_CODE_DISCONNECT_REQUEST].irt), .dflt = STRINGIFY(2) },
{ FR_CONF_OFFSET("max_rtx_time", rlm_radius_t, retry[FR_RADIUS_CODE_DISCONNECT_REQUEST].mrt), .dflt = STRINGIFY(16) },
{ FR_CONF_OFFSET("max_rtx_count", rlm_radius_t, retry[FR_RADIUS_CODE_DISCONNECT_REQUEST].mrc), .dflt = STRINGIFY(5) },
{ FR_CONF_OFFSET("max_rtx_duration", rlm_radius_t, retry[FR_RADIUS_CODE_DISCONNECT_REQUEST].mrd), .dflt = STRINGIFY(30) },
}
@ FR_RADIUS_CODE_DISCONNECT_REQUEST
RFC3575/RFC5176 - Disconnect-Request.
Definition: defs.h:46

Definition at line 89 of file rlm_radius.c.

◆ module_config

conf_parser_t const module_config[]
static

Definition at line 101 of file rlm_radius.c.

◆ rlm_radius

module_rlm_t rlm_radius
Initial value:
= {
.common = {
.name = "radius",
.inst_size = sizeof(rlm_radius_t),
.onload = mod_load,
.unload = mod_unload,
.detach = mod_detach
},
.method_group = {
.bindings = (module_method_binding_t[]){
{ .section = SECTION_NAME(CF_IDENT_ANY, CF_IDENT_ANY), .method = mod_process },
},
}
}
#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_radius.c:636
static int mod_load(void)
Definition: rlm_radius.c:644
static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
Send packets outbound.
Definition: rlm_radius.c:395
static void mod_unload(void)
Definition: rlm_radius.c:653
static int mod_instantiate(module_inst_ctx_t const *mctx)
Definition: rlm_radius.c:460
static conf_parser_t const module_config[]
Definition: rlm_radius.c:101
struct rlm_radius_s rlm_radius_t
Definition: rlm_radius.h:36
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 668 of file rlm_radius.c.

◆ rlm_radius_dict

fr_dict_autoload_t rlm_radius_dict
Initial value:
= {
{ .out = &dict_radius, .proto = "radius" },
{ NULL }
}
static fr_dict_t const * dict_radius
Definition: rlm_radius.c:143

Definition at line 146 of file rlm_radius.c.

◆ rlm_radius_dict_attr

fr_dict_attr_autoload_t rlm_radius_dict_attr
Initial value:
= {
{ .out = &attr_chap_challenge, .name = "CHAP-Challenge", .type = FR_TYPE_OCTETS, .dict = &dict_radius},
{ .out = &attr_chap_password, .name = "CHAP-Password", .type = FR_TYPE_OCTETS, .dict = &dict_radius},
{ .out = &attr_packet_type, .name = "Packet-Type", .type = FR_TYPE_UINT32, .dict = &dict_radius },
{ .out = &attr_proxy_state, .name = "Proxy-State", .type = FR_TYPE_OCTETS, .dict = &dict_radius},
{ NULL }
}
@ FR_TYPE_UINT32
32 Bit unsigned integer.
Definition: merged_model.c:99
@ FR_TYPE_OCTETS
Raw octets.
Definition: merged_model.c:84
static fr_dict_attr_t const * attr_packet_type
Definition: rlm_radius.c:153
static fr_dict_attr_t const * attr_chap_password
Definition: rlm_radius.c:152
static fr_dict_attr_t const * attr_chap_challenge
Definition: rlm_radius.c:151
static fr_dict_attr_t const * attr_proxy_state
Definition: rlm_radius.c:154

Definition at line 157 of file rlm_radius.c.

◆ status_check_config

conf_parser_t const status_check_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET_TYPE_FLAGS("type", FR_TYPE_VOID, 0, rlm_radius_t, status_check),
}
#define FR_CONF_OFFSET_TYPE_FLAGS(_name, _type, _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:241
@ FR_TYPE_VOID
User data.
Definition: merged_model.c:127
static int status_check_type_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)

Definition at line 38 of file rlm_radius.c.

◆ status_check_update_config

conf_parser_t const status_check_update_config[]
static
Initial value:
= {
.name2 = CF_IDENT_ANY,
{ FR_CONF_OFFSET("num_answers_to_alive", rlm_radius_t, num_answers_to_alive), .dflt = STRINGIFY(3) },
}
@ 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_SUBSECTION
Instead of putting the information into a configuration structure, the configuration file routines MA...
Definition: cf_parse.h:399
static int status_check_update_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)

Definition at line 45 of file rlm_radius.c.

◆ status_config

conf_parser_t status_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET("initial_rtx_time", rlm_radius_t, retry[FR_RADIUS_CODE_STATUS_SERVER].irt), .dflt = STRINGIFY(2) },
{ FR_CONF_OFFSET("max_rtx_time", rlm_radius_t, retry[FR_RADIUS_CODE_STATUS_SERVER].mrt), .dflt = STRINGIFY(5) },
{ FR_CONF_OFFSET("max_rtx_count", rlm_radius_t, retry[FR_RADIUS_CODE_STATUS_SERVER].mrc), .dflt = STRINGIFY(5) },
{ FR_CONF_OFFSET("max_rtx_duration", rlm_radius_t, retry[FR_RADIUS_CODE_STATUS_SERVER].mrd), .dflt = STRINGIFY(30) },
}
@ FR_RADIUS_CODE_STATUS_SERVER
RFC2865/RFC5997 - Status Server (request)
Definition: defs.h:44

Definition at line 73 of file rlm_radius.c.

◆ type_interval_config

conf_parser_t const type_interval_config[FR_RADIUS_CODE_MAX]
static
Initial value:
= {
[FR_RADIUS_CODE_ACCESS_REQUEST] = { FR_CONF_POINTER("Access-Request", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) auth_config },
[FR_RADIUS_CODE_ACCOUNTING_REQUEST] = { FR_CONF_POINTER("Accounting-Request", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) acct_config },
[FR_RADIUS_CODE_STATUS_SERVER] = { FR_CONF_POINTER("Status-Server", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) status_config },
[FR_RADIUS_CODE_COA_REQUEST] = { FR_CONF_POINTER("CoA-Request", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) coa_config },
[FR_RADIUS_CODE_DISCONNECT_REQUEST] = { FR_CONF_POINTER("Disconnect-Request", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) disconnect_config },
}
#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
static conf_parser_t coa_config[]
Definition: rlm_radius.c:81
static conf_parser_t disconnect_config[]
Definition: rlm_radius.c:89
static conf_parser_t status_config[]
Definition: rlm_radius.c:73
static conf_parser_t auth_config[]
Definition: rlm_radius.c:57
static conf_parser_t acct_config[]
Definition: rlm_radius.c:65

Definition at line 134 of file rlm_radius.c.