Process simple 'users' policy files.
More...
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/server/module_rlm.h>
#include <freeradius-devel/server/pairmove.h>
#include <freeradius-devel/server/users_file.h>
#include <freeradius-devel/util/htrie.h>
#include <freeradius-devel/unlang/call_env.h>
#include <freeradius-devel/unlang/function.h>
#include <freeradius-devel/unlang/transaction.h>
#include <ctype.h>
#include <fcntl.h>
Go to the source code of this file.
|
static int | call_env_parse (TALLOC_CTX *ctx, void *out, tmpl_rules_t const *t_rules, CONF_ITEM *ci, call_env_ctx_t const *cec, UNUSED call_env_parser_t const *rule) |
| Custom call_env parser for loading files data. More...
|
|
static int | getrecv_filename (TALLOC_CTX *ctx, char const *filename, fr_htrie_t **ptree, PAIR_LIST_LIST **pdefault, fr_type_t data_type, fr_dict_attr_t const *key_enum, fr_dict_t const *dict) |
|
static unlang_action_t | mod_files (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request) |
| Initiate a files data lookup. More...
|
|
static unlang_action_t | mod_files_resume (rlm_rcode_t *p_result, UNUSED int *priority, request_t *request, void *uctx) |
| Lookup the expanded key value in files data. More...
|
|
static int8_t | pairlist_cmp (void const *a, void const *b) |
|
static uint32_t | pairlist_hash (void const *a) |
|
static int | pairlist_to_key (uint8_t **out, size_t *outlen, void const *a) |
|
Process simple 'users' policy files.
- Id
- f8e96ec7f41a8c40c96119b5d61e6b1c9a7f186d
- Copyright
- 2000,2006 The FreeRADIUS server project
-
2000 Jeff Carneal (jeff@.nosp@m.apex.nosp@m..net)
Definition in file rlm_files.c.
◆ rlm_files_data_t
Structure produced by custom call_env parser.
Definition at line 45 of file rlm_files.c.
Data Fields |
PAIR_LIST_LIST * |
def |
parsed files DEFAULT data. |
fr_htrie_t * |
htrie |
parsed files "user" data. |
tmpl_t * |
key_tmpl |
tmpl used to evaluate lookup key. |
◆ rlm_files_env_t
Call_env structure.
Definition at line 53 of file rlm_files.c.
Data Fields |
rlm_files_data_t * |
data |
Data from parsed call_env. |
tmpl_t * |
match_attr |
Attribute to populate with matched key value. |
char const * |
name |
Name of module instance - for debug output. |
fr_value_box_list_t |
values |
Where the expanded tmpl value will be written. |
◆ rlm_files_t
Definition at line 39 of file rlm_files.c.
Data Fields |
char const * |
filename |
|
◆ call_env_parse()
Custom call_env parser for loading files data.
Definition at line 652 of file rlm_files.c.
◆ getrecv_filename()
◆ mod_files()
Initiate a files data lookup.
The results of call_env parsing are a structure containing the tmpl_t representing the key and the parsed files data, meaning tmpl expansion does not happen by default. First we push the tmpl onto the stack for evaluation, then the lookup is done in mod_files_resume.
Definition at line 630 of file rlm_files.c.
◆ mod_files_resume()
Lookup the expanded key value in files data.
Definition at line 399 of file rlm_files.c.
◆ pairlist_cmp()
static int8_t pairlist_cmp |
( |
void const * |
a, |
|
|
void const * |
b |
|
) |
| |
|
static |
◆ pairlist_hash()
static uint32_t pairlist_hash |
( |
void const * |
a | ) |
|
|
static |
◆ pairlist_to_key()
static int pairlist_to_key |
( |
uint8_t ** |
out, |
|
|
size_t * |
outlen, |
|
|
void const * |
a |
|
) |
| |
|
static |
◆ attr_fall_through
◆ attr_next_shortest_prefix
◆ dict_freeradius
◆ method_env
Initial value:= {
},
}
#define CALL_ENV_TERMINATOR
#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...
@ CALL_ENV_FLAG_ATTRIBUTE
Tmpl must contain an attribute reference.
@ CALL_ENV_FLAG_PARSE_ONLY
The result of parsing will not be evaluated at runtime.
#define FR_CALL_ENV_PARSE_ONLY_OFFSET(_name, _cast_type, _flags, _struct, _parse_field)
Specify a call_env_parser_t which writes out the result of the parsing phase to the field specified.
static int call_env_parse(TALLOC_CTX *ctx, void *out, tmpl_rules_t const *t_rules, CONF_ITEM *ci, call_env_ctx_t const *cec, UNUSED call_env_parser_t const *rule)
Custom call_env parser for loading files data.
Definition at line 687 of file rlm_files.c.
◆ module_config
Initial value:= {
}
#define CONF_PARSER_TERMINATOR
#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
@ CONF_FLAG_REQUIRED
Error out if no matching CONF_PAIR is found, and no dflt value is set.
@ CONF_FLAG_FILE_INPUT
File matching value must exist, and must be readable.
Definition at line 79 of file rlm_files.c.
◆ rlm_files
Initial value:= {
.common = {
.name = "files",
},
.method_group = {
}
}
}
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
static const conf_parser_t config[]
static const call_env_method_t method_env
static unlang_action_t mod_files(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
Initiate a files data lookup.
static const conf_parser_t module_config[]
#define SECTION_NAME(_name1, _name2)
Define a section name consisting of a verb and a noun.
#define MODULE_BINDING_TERMINATOR
Terminate a module binding list.
Named methods exported by a module.
Definition at line 700 of file rlm_files.c.
◆ rlm_files_dict
Initial value:= {
{ NULL }
}
static fr_dict_t const * dict_freeradius
Definition at line 63 of file rlm_files.c.
◆ rlm_files_dict_attr
Initial value:= {
{ NULL }
}
@ FR_TYPE_BOOL
A truth value.
static fr_dict_attr_t const * attr_fall_through
static fr_dict_attr_t const * attr_next_shortest_prefix
Definition at line 72 of file rlm_files.c.