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

test module code. More...

#include <freeradius-devel/server/base.h>
#include <freeradius-devel/server/module_rlm.h>
#include <freeradius-devel/server/tmpl.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/util/inet.h>
#include <freeradius-devel/unlang/xlat_func.h>
+ Include dependency graph for rlm_test.c:

Go to the source code of this file.

Data Structures

struct  rlm_test_t
 
struct  rlm_test_thread_t
 

Macros

#define LOG_PREFIX   mctx->mi->name
 

Functions

static unlang_action_t mod_accounting (rlm_rcode_t *p_result, module_ctx_t const *mctx, UNUSED request_t *request)
 
static unlang_action_t mod_authenticate (rlm_rcode_t *p_result, module_ctx_t const *mctx, UNUSED request_t *request)
 
static unlang_action_t mod_authorize (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
 
static int mod_bootstrap (module_inst_ctx_t const *mctx)
 
static int mod_load (void)
 
static unlang_action_t mod_preacct (rlm_rcode_t *p_result, module_ctx_t const *mctx, UNUSED request_t *request)
 
static unlang_action_t mod_retry (UNUSED rlm_rcode_t *p_result, UNUSED module_ctx_t const *mctx, request_t *request)
 
static unlang_action_t mod_retry_resume (rlm_rcode_t *p_result, UNUSED module_ctx_t const *mctx, request_t *request)
 Continue after marked runnable. More...
 
static unlang_action_t mod_retry_resume_retry (UNUSED rlm_rcode_t *p_result, UNUSED module_ctx_t const *mctx, request_t *request)
 Continue after FR_SIGNAL_RETRY. More...
 
static unlang_action_t mod_retry_resume_timeout (rlm_rcode_t *p_result, UNUSED module_ctx_t const *mctx, request_t *request)
 Continue after FR_SIGNAL_TIMEOUT. More...
 
static void mod_retry_signal (module_ctx_t const *mctx, request_t *request, fr_signal_t action)
 
static void mod_retry_signal (UNUSED module_ctx_t const *mctx, request_t *request, fr_signal_t action)
 
static unlang_action_t mod_return (rlm_rcode_t *p_result, UNUSED module_ctx_t const *mctx, UNUSED request_t *request)
 
static int mod_thread_detach (module_thread_inst_ctx_t const *mctx)
 
static int mod_thread_instantiate (module_thread_inst_ctx_t const *mctx)
 
static void mod_unload (void)
 
static xlat_action_t test_xlat_fail (UNUSED TALLOC_CTX *ctx, UNUSED fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, UNUSED request_t *request, UNUSED fr_value_box_list_t *in)
 Always return XLAT_ACTION_FAIL. More...
 
static xlat_action_t test_xlat_passthrough (TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, UNUSED request_t *request, fr_value_box_list_t *in)
 Run a generic xlat (useful for testing) More...
 
static xlat_action_t trigger_test_xlat (TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in)
 Run a trigger (useful for testing) More...
 

Variables

static fr_dict_attr_t const * attr_user_name
 
static fr_dict_t const * dict_radius
 
static const conf_parser_t module_config []
 
module_rlm_t rlm_test
 
fr_dict_autoload_t rlm_test_dict []
 
fr_dict_attr_autoload_t rlm_test_dict_attr []
 
static xlat_arg_parser_t const test_xlat_fail_args []
 
static xlat_arg_parser_t const test_xlat_passthrough_args []
 
static xlat_arg_parser_t const trigger_test_xlat_args []
 

Detailed Description

test module code.

Id
ff3e1336ee384078ce1e3bb49f99e00307df4f91

Definition in file rlm_test.c.


Data Structure Documentation

◆ rlm_test_t

struct rlm_test_t

Definition at line 43 of file rlm_test.c.

+ Collaboration diagram for rlm_test_t:
Data Fields
bool boolean
bool * boolean_m
uint8_t byte
uint8_t * byte_m
fr_ipaddr_t combo_ipaddr
fr_ipaddr_t * combo_ipaddr_m
fr_time_t date
fr_time_t * date_m
fr_ethernet_t ethernet
fr_ethernet_t * ethernet_m
fr_ifid_t ifid
fr_ifid_t * ifid_m
int32_t int32
int32_t * int32_m
uint32_t integer
uint32_t * integer_m
fr_ipaddr_t ipaddr
fr_ipaddr_t ipv4_addr
fr_ipaddr_t * ipv4_addr_m
fr_ipaddr_t ipv4_prefix
fr_ipaddr_t * ipv4_prefix_m
fr_ipaddr_t ipv6_addr
fr_ipaddr_t * ipv6_addr_m
fr_ipaddr_t ipv6_prefix
fr_ipaddr_t * ipv6_prefix_m
uint8_t const * octets
uint8_t const ** octets_m
uint16_t shortint
uint16_t * shortint_m
char const * string
char const ** string_m
fr_time_delta_t time_delta
fr_time_delta_t * time_delta_m
tmpl_t * tmpl
tmpl_t ** tmpl_m
uint64_t uint64
uint64_t * uint64_m

◆ rlm_test_thread_t

struct rlm_test_thread_t

Definition at line 113 of file rlm_test.c.

+ Collaboration diagram for rlm_test_thread_t:
Data Fields
rlm_test_t * inst
pthread_t value

Macro Definition Documentation

◆ LOG_PREFIX

#define LOG_PREFIX   mctx->mi->name

Definition at line 27 of file rlm_test.c.

Function Documentation

◆ mod_accounting()

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

Definition at line 258 of file rlm_test.c.

◆ mod_authenticate()

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

Definition at line 234 of file rlm_test.c.

◆ mod_authorize()

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

Definition at line 201 of file rlm_test.c.

◆ mod_bootstrap()

static int mod_bootstrap ( module_inst_ctx_t const *  mctx)
static

Definition at line 452 of file rlm_test.c.

+ Here is the call graph for this function:

◆ mod_load()

static int mod_load ( void  )
static

Definition at line 492 of file rlm_test.c.

+ Here is the call graph for this function:

◆ mod_preacct()

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

Definition at line 246 of file rlm_test.c.

◆ mod_retry()

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

Definition at line 334 of file rlm_test.c.

+ Here is the call graph for this function:

◆ mod_retry_resume()

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

Continue after marked runnable.

Definition at line 280 of file rlm_test.c.

+ Here is the caller graph for this function:

◆ mod_retry_resume_retry()

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

Continue after FR_SIGNAL_RETRY.

Definition at line 290 of file rlm_test.c.

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

◆ mod_retry_resume_timeout()

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

Continue after FR_SIGNAL_TIMEOUT.

Definition at line 300 of file rlm_test.c.

+ Here is the caller graph for this function:

◆ mod_retry_signal() [1/2]

static void mod_retry_signal ( module_ctx_t const *  mctx,
request_t request,
fr_signal_t  action 
)
static
+ Here is the caller graph for this function:

◆ mod_retry_signal() [2/2]

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

Definition at line 307 of file rlm_test.c.

+ Here is the call graph for this function:

◆ mod_return()

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

Definition at line 270 of file rlm_test.c.

◆ mod_thread_detach()

static int mod_thread_detach ( module_thread_inst_ctx_t const *  mctx)
static

Definition at line 431 of file rlm_test.c.

◆ mod_thread_instantiate()

static int mod_thread_instantiate ( module_thread_inst_ctx_t const *  mctx)
static

Definition at line 419 of file rlm_test.c.

◆ mod_unload()

static void mod_unload ( void  )
static

Definition at line 502 of file rlm_test.c.

+ Here is the call graph for this function:

◆ test_xlat_fail()

static xlat_action_t test_xlat_fail ( UNUSED TALLOC_CTX *  ctx,
UNUSED fr_dcursor_t out,
UNUSED xlat_ctx_t const *  xctx,
UNUSED request_t request,
UNUSED fr_value_box_list_t *  in 
)
static

Always return XLAT_ACTION_FAIL.

Definition at line 411 of file rlm_test.c.

+ Here is the caller graph for this function:

◆ test_xlat_passthrough()

static xlat_action_t test_xlat_passthrough ( TALLOC_CTX *  ctx,
fr_dcursor_t out,
UNUSED xlat_ctx_t const *  xctx,
UNUSED request_t request,
fr_value_box_list_t *  in 
)
static

Run a generic xlat (useful for testing)

This just copies the input to the output.

Definition at line 382 of file rlm_test.c.

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

◆ trigger_test_xlat()

static xlat_action_t trigger_test_xlat ( TALLOC_CTX *  ctx,
fr_dcursor_t out,
UNUSED xlat_ctx_t const *  xctx,
request_t request,
fr_value_box_list_t *  in 
)
static

Run a trigger (useful for testing)

Definition at line 349 of file rlm_test.c.

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

Variable Documentation

◆ attr_user_name

fr_dict_attr_t const* attr_user_name
static

Definition at line 187 of file rlm_test.c.

◆ dict_radius

fr_dict_t const* dict_radius
static

Definition at line 179 of file rlm_test.c.

◆ module_config

const conf_parser_t module_config[]
static

Definition at line 121 of file rlm_test.c.

◆ rlm_test

module_rlm_t rlm_test

Definition at line 517 of file rlm_test.c.

◆ rlm_test_dict

fr_dict_autoload_t rlm_test_dict
Initial value:
= {
{ .out = &dict_radius, .proto = "radius" },
{ NULL }
}
static fr_dict_t const * dict_radius
Definition: rlm_test.c:179

Definition at line 182 of file rlm_test.c.

◆ rlm_test_dict_attr

fr_dict_attr_autoload_t rlm_test_dict_attr
Initial value:
= {
{ .out = &attr_user_name, .name = "User-Name", .type = FR_TYPE_STRING, .dict = &dict_radius },
{ NULL }
}
@ FR_TYPE_STRING
String of printable characters.
Definition: merged_model.c:83
static fr_dict_attr_t const * attr_user_name
Definition: rlm_test.c:187

Definition at line 190 of file rlm_test.c.

◆ test_xlat_fail_args

xlat_arg_parser_t const test_xlat_fail_args[]
static
Initial value:
= {
{ .required = false, .concat = true, .type = FR_TYPE_STRING },
}
#define XLAT_ARG_PARSER_TERMINATOR
Definition: xlat.h:166

Definition at line 403 of file rlm_test.c.

◆ test_xlat_passthrough_args

xlat_arg_parser_t const test_xlat_passthrough_args[]
static
Initial value:
= {
{ .required = true, .concat = true, .type = FR_TYPE_STRING },
{ .variadic = XLAT_ARG_VARIADIC_EMPTY_KEEP, .concat = true, .type = FR_TYPE_STRING },
}
@ XLAT_ARG_VARIADIC_EMPTY_KEEP
Empty argument groups are left alone, and either passed through as empty groups or null boxes.
Definition: xlat.h:137

Definition at line 371 of file rlm_test.c.

◆ trigger_test_xlat_args

xlat_arg_parser_t const trigger_test_xlat_args[]
static
Initial value:
= {
{ .required = true, .single = true, .type = FR_TYPE_STRING },
}

Definition at line 340 of file rlm_test.c.