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

Retrieve attributes from a dict. More...

#include <freeradius-devel/server/base.h>
#include <freeradius-devel/server/module_rlm.h>
#include <freeradius-devel/server/log.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/util/sbuff.h>
#include <freeradius-devel/util/value.h>
#include <freeradius-devel/unlang/xlat.h>
#include <freeradius-devel/unlang/xlat_func.h>
+ Include dependency graph for rlm_dict.c:

Go to the source code of this file.

Macros

#define XLAT_REGISTER(_name, _func, _type, _args)
 

Functions

static int mod_load (void)
 
static void mod_unload (void)
 
static xlat_action_t xlat_attr (TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in)
 Return the attribute name of an attribute reference. More...
 
static xlat_action_t xlat_attr_num (TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in)
 Return the attribute number of an attribute reference. More...
 
static xlat_action_t xlat_attr_oid (TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in)
 Return the attribute number of an attribute reference. More...
 
static xlat_action_t xlat_attr_type (TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in)
 Return the data type of an attribute reference. More...
 
static xlat_action_t xlat_dict_attr_by_num (TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in)
 Xlat for attr_by_num(<number>) More...
 
static xlat_action_t xlat_dict_attr_by_oid (TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in)
 Xlat for attr_by_oid(<oid>) More...
 
static int xlat_fmt_get_vp (fr_pair_t **out, request_t *request, char const *name)
 Return a VP from the specified request. More...
 
static xlat_action_t xlat_vendor (TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in)
 Return the vendor of an attribute reference. More...
 
static xlat_action_t xlat_vendor_num (TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in)
 Return the vendor number of an attribute reference. More...
 

Variables

module_rlm_t rlm_dict
 
static xlat_arg_parser_t const xlat_attr_args []
 
static xlat_arg_parser_t const xlat_attr_num_args []
 
static xlat_arg_parser_t const xlat_attr_oid_args []
 
static xlat_arg_parser_t const xlat_dict_attr_by_num_args []
 
static xlat_arg_parser_t const xlat_dict_attr_by_oid_args []
 
static xlat_arg_parser_t const xlat_vendor_args []
 
static xlat_arg_parser_t const xlat_vendor_num_args []
 

Detailed Description

Retrieve attributes from a dict.

Id
f95cedb1e85d180651987a4ffa161e87b4b2de04

Definition in file rlm_dict.c.

Macro Definition Documentation

◆ XLAT_REGISTER

#define XLAT_REGISTER (   _name,
  _func,
  _type,
  _args 
)
Value:
if (unlikely(!(xlat = xlat_func_register(NULL, _name, _func, _type)))) return -1; \
xlat_func_args_set(xlat, _args)
#define unlikely(_x)
Definition: build.h:379
xlat_t * xlat_func_register(TALLOC_CTX *ctx, char const *name, xlat_func_t func, fr_type_t return_type)
Register an xlat function.
Definition: xlat_func.c:218

Definition at line 316 of file rlm_dict.c.

Function Documentation

◆ mod_load()

static int mod_load ( void  )
static

Definition at line 320 of file rlm_dict.c.

+ Here is the call graph for this function:

◆ mod_unload()

static void mod_unload ( void  )
static

Definition at line 335 of file rlm_dict.c.

+ Here is the call graph for this function:

◆ xlat_fmt_get_vp()

static int xlat_fmt_get_vp ( fr_pair_t **  out,
request_t request,
char const *  name 
)
static

Return a VP from the specified request.

Parameters
outwhere to write the pointer to the resolved VP. Will be NULL if the attribute couldn't be resolved.
requestcurrent request.
nameattribute name including qualifiers.
Returns
  • -4 if either the attribute or qualifier were invalid.
  • The same error codes as tmpl_find_vp for other error conditions.

Definition at line 45 of file rlm_dict.c.

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

Variable Documentation

◆ rlm_dict

module_rlm_t rlm_dict
Initial value:
= {
.common = {
.name = "dict",
.onload = mod_load,
.unload = mod_unload
}
}
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
Definition: dl_module.h:63
static int mod_load(void)
Definition: rlm_dict.c:320
static void mod_unload(void)
Definition: rlm_dict.c:335

Definition at line 348 of file rlm_dict.c.

◆ xlat_attr_args

xlat_arg_parser_t const xlat_attr_args[]
static
Initial value:
= {
{ .required = true, .single = true, .type = FR_TYPE_STRING },
}
@ FR_TYPE_STRING
String of printable characters.
Definition: merged_model.c:83
#define XLAT_ARG_PARSER_TERMINATOR
Definition: xlat.h:166

Definition at line 200 of file rlm_dict.c.

◆ xlat_attr_num_args

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

Definition at line 230 of file rlm_dict.c.

◆ xlat_attr_oid_args

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

Definition at line 256 of file rlm_dict.c.

◆ xlat_dict_attr_by_num_args

xlat_arg_parser_t const xlat_dict_attr_by_num_args[]
static
Initial value:
= {
{ .required = true, .single = true, .type = FR_TYPE_UINT32 },
}
@ FR_TYPE_UINT32
32 Bit unsigned integer.
Definition: merged_model.c:99

Definition at line 68 of file rlm_dict.c.

◆ xlat_dict_attr_by_oid_args

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

Definition at line 102 of file rlm_dict.c.

◆ xlat_vendor_args

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

Definition at line 141 of file rlm_dict.c.

◆ xlat_vendor_num_args

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

Definition at line 175 of file rlm_dict.c.