#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/modules.h>
#include <freeradius-devel/parser.h>
#include <freeradius-devel/rad_assert.h>
#include <ctype.h>
Go to the source code of this file.
|
static bool | all_digits (char const *string) |
|
static int | cond_cmp_values (REQUEST *request, fr_cond_t const *c, PW_TYPE lhs_type, value_data_t const *lhs, PW_TYPE rhs_type, value_data_t const *rhs) |
| Call the correct data comparison function for the condition. More...
|
|
static int | cond_normalise_and_cmp (REQUEST *request, fr_cond_t const *c, PW_TYPE lhs_type, fr_dict_attr_t const *lhs_enumv, value_data_t const *lhs) |
| Convert both operands to the same type. More...
|
|
int | radius_evaluate_cond (REQUEST *request, int modreturn, int depth, fr_cond_t const *c) |
| Evaluate a fr_cond_t;. More...
|
|
int | radius_evaluate_map (REQUEST *request, UNUSED int modreturn, UNUSED int depth, fr_cond_t const *c) |
| Evaluate a map. More...
|
|
int | radius_evaluate_tmpl (REQUEST *request, int modreturn, UNUSED int depth, vp_tmpl_t const *vpt) |
| Evaluate a template. More...
|
|
void | radius_pairmove (REQUEST *request, VALUE_PAIR **to, VALUE_PAIR *from, bool do_xlat) |
|
Value:do {\
if (
value_data_cast(request, &_s ## _cast, cast_type, cast, _s ## _type, _s ## _enumv, _s) < 0) {
\
rcode = -1;\
goto finish;\
}\
if (cast && cast->flags.is_pointer) _s ## _cast_buff = _s ## _cast.ptr;\
_s ## _type = cast_type;\
_s = &_s ## _cast;\
}\
} while (0)
int value_data_cast(TALLOC_CTX *ctx, value_data_t *dst, PW_TYPE dst_type, fr_dict_attr_t const *dst_enumv, PW_TYPE src_type, fr_dict_attr_t const *src_enumv, value_data_t const *src)
Convert one type of value_data_t to another.
const FR_NAME_NUMBER dict_attr_types[]
Map data types to names representing those types.
Invalid (uninitialised) attribute type.
char const * fr_strerror(void)
Get the last library error.
char const * fr_int2str(FR_NAME_NUMBER const *table, int number, char const *def)
#define CHECK_INT_CAST |
( |
|
_l, |
|
|
|
_r |
|
) |
| |
Value:do {\
EVAL_DEBUG(
"OPERANDS ARE NUMBER STRINGS, SETTING CAST TO integer64");\
}\
} while (0)
Invalid (uninitialised) attribute type.
static bool all_digits(char const *string)
String of printable characters.
#define EVAL_DEBUG |
( |
|
... | ) |
|
static bool all_digits |
( |
char const * |
string | ) |
|
|
static |
Call the correct data comparison function for the condition.
Deals with regular expression comparisons, virtual attribute comparisons, and data comparisons.
- Returns
- -1 on failure.
- 0 for "no match".
- 1 for "match".
Definition at line 288 of file evaluate.c.
Convert both operands to the same type.
If casting is successful, we call cond_cmp_values to do the comparison
- Returns
- -1 on failure.
- 0 for "no match".
- 1 for "match".
Definition at line 367 of file evaluate.c.
int radius_evaluate_cond |
( |
REQUEST * |
request, |
|
|
int |
modreturn, |
|
|
int |
depth, |
|
|
fr_cond_t const * |
c |
|
) |
| |
Evaluate a fr_cond_t;.
- Parameters
-
[in] | request | the REQUEST |
[in] | modreturn | the previous module return code |
[in] | depth | of the recursion (only used for debugging) |
[in] | c | the condition to evaluate |
- Returns
- -1 on failure.
- -2 on attribute not found.
- 0 for "no match".
- 1 for "match".
Definition at line 701 of file evaluate.c.
Evaluate a map.
- Parameters
-
[in] | request | the REQUEST |
[in] | modreturn | the previous module return code |
[in] | depth | of the recursion (only used for debugging) |
[in] | c | the condition to evaluate |
- Returns
- -1 on failure.
- 0 for "no match".
- 1 for "match".
Definition at line 593 of file evaluate.c.
Evaluate a template.
Converts a vp_tmpl_t to a boolean value.
- Parameters
-
[in] | request | the REQUEST |
[in] | modreturn | the previous module return code |
[in] | depth | of the recursion (only used for debugging) |
[in] | vpt | the template to evaluate |
- Returns
- -1 on failure.
- 0 for "no match".
- 1 for "match".
Definition at line 82 of file evaluate.c.
Initial value:= {
{ NULL, 0 }
}
The module is OK, continue.
The module considers the request invalid.
Reject the request (user is locked out).
Immediately reject the request.
Module succeeded without doing anything.
Module failed, don't reply.
The module handled the request, so stop.
Definition at line 40 of file evaluate.c.