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

Switches between retuning different return codes. More...

#include <freeradius-devel/server/base.h>
#include <freeradius-devel/server/module_rlm.h>
#include <freeradius-devel/radius/radius.h>
#include <freeradius-devel/util/debug.h>
+ Include dependency graph for rlm_sometimes.c:

Go to the source code of this file.

Data Structures

struct  rlm_sometimes_t
 

Functions

static int mod_instantiate (module_inst_ctx_t const *mctx)
 
static unlang_action_t mod_sometimes_packet (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
 
static unlang_action_t mod_sometimes_reply (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
 
static unlang_action_t sometimes_return (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request, fr_packet_t *packet, fr_packet_t *reply)
 

Variables

static const conf_parser_t module_config []
 
module_rlm_t rlm_sometimes
 

Detailed Description

Switches between retuning different return codes.

Id
5db3c666482776066857f6a25939f3137f3dfac4

Definition in file rlm_sometimes.c.


Data Structure Documentation

◆ rlm_sometimes_t

struct rlm_sometimes_t

Definition at line 35 of file rlm_sometimes.c.

+ Collaboration diagram for rlm_sometimes_t:
Data Fields
tmpl_t * key
float percentage
rlm_rcode_t rcode
char const * rcode_str

Function Documentation

◆ mod_instantiate()

static int mod_instantiate ( module_inst_ctx_t const *  mctx)
static

Definition at line 49 of file rlm_sometimes.c.

◆ mod_sometimes_packet()

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

Definition at line 145 of file rlm_sometimes.c.

+ Here is the call graph for this function:

◆ mod_sometimes_reply()

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

Definition at line 150 of file rlm_sometimes.c.

+ Here is the call graph for this function:

◆ sometimes_return()

static unlang_action_t sometimes_return ( rlm_rcode_t p_result,
module_ctx_t const *  mctx,
request_t request,
fr_packet_t packet,
fr_packet_t reply 
)
static

Definition at line 74 of file rlm_sometimes.c.

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

Variable Documentation

◆ module_config

const conf_parser_t module_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET("rcode", rlm_sometimes_t, rcode_str), .dflt = "fail" },
{ FR_CONF_OFFSET_FLAGS("key", CONF_FLAG_ATTRIBUTE, rlm_sometimes_t, key), .dflt = "&User-Name", .quote = T_BARE_WORD },
{ FR_CONF_OFFSET("percentage", rlm_sometimes_t, percentage), .dflt = "0" },
}
#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_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_ATTRIBUTE
Value must resolve to attribute in dict (deprecated, use CONF_FLAG_TMPL).
Definition: cf_parse.h:407
@ T_BARE_WORD
Definition: token.h:120

Definition at line 42 of file rlm_sometimes.c.

◆ rlm_sometimes

module_rlm_t rlm_sometimes
Initial value:
= {
.common = {
.name = "sometimes",
.inst_size = sizeof(rlm_sometimes_t),
},
.method_group = {
.bindings = (module_method_binding_t[]){
{ .section = SECTION_NAME("send", CF_IDENT_ANY), .method = mod_sometimes_reply },
}
}
}
#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 instantiate(module_inst_ctx_t const *mctx)
Definition: rlm_rest.c:1302
static unlang_action_t mod_sometimes_reply(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
static const conf_parser_t module_config[]
Definition: rlm_sometimes.c:42
static unlang_action_t mod_sometimes_packet(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
static int mod_instantiate(module_inst_ctx_t const *mctx)
Definition: rlm_sometimes.c:49
#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 156 of file rlm_sometimes.c.