Valuepair functions that are radiusd-specific and as such do not belong in the library. More...
#include <ctype.h>
#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/rad_assert.h>
Go to the source code of this file.
Data Structures | |
struct | cmp |
Functions | |
void | debug_pair (VALUE_PAIR *vp) |
Print a single valuepair to stderr or error log. More... | |
void | module_failure_msg (REQUEST *request, char const *fmt,...) |
static bool | otherattr (fr_dict_attr_t const *attribute, fr_dict_attr_t const **from) |
See what attribute we want to compare with. More... | |
int | paircompare (REQUEST *request, VALUE_PAIR *req_list, VALUE_PAIR *check, VALUE_PAIR **rep_list) |
Compare two pair lists except for the password information. More... | |
int | paircompare_register (fr_dict_attr_t const *attribute, fr_dict_attr_t const *from, bool first_only, RAD_COMPARE_FUNC func, void *instance) |
Register a function as compare function. More... | |
int | paircompare_register_byname (char const *name, fr_dict_attr_t const *from, bool first_only, RAD_COMPARE_FUNC func, void *instance) |
Register a function as compare function. More... | |
void | paircompare_unregister (fr_dict_attr_t const *attribute, RAD_COMPARE_FUNC func) |
Unregister comparison function for an attribute. More... | |
void | paircompare_unregister_instance (void *instance) |
Unregister comparison function for a module. More... | |
int | radius_callback_compare (REQUEST *request, VALUE_PAIR *req, VALUE_PAIR *check, VALUE_PAIR *check_pairs, VALUE_PAIR **reply_pairs) |
Compare check and vp. More... | |
int | radius_compare_vps (UNUSED REQUEST *request, VALUE_PAIR *check, VALUE_PAIR *vp) |
Compares check and vp by value. More... | |
int | radius_copy_vp (TALLOC_CTX *ctx, VALUE_PAIR **out, REQUEST *request, char const *name) |
Copy VP(s) from the specified request. More... | |
int | radius_find_compare (fr_dict_attr_t const *attribute) |
Find a comparison function for two attributes. More... | |
int | radius_get_vp (VALUE_PAIR **out, REQUEST *request, char const *name) |
Return a VP from the specified request. More... | |
VALUE_PAIR * | radius_pair_create (TALLOC_CTX *ctx, VALUE_PAIR **vps, unsigned int attribute, unsigned int vendor) |
Create a VALUE_PAIR and add it to a list of VALUE_PAIR s. More... | |
int | radius_xlat_do (REQUEST *request, VALUE_PAIR *vp) |
Expands an attribute marked with fr_pair_mark_xlat. More... | |
void | rdebug_pair (log_lvl_t level, REQUEST *request, VALUE_PAIR *vp, char const *prefix) |
Print a single valuepair to stderr or error log. More... | |
void | rdebug_pair_list (log_lvl_t level, REQUEST *request, VALUE_PAIR *vp, char const *prefix) |
Print a list of VALUE_PAIRs. More... | |
void | rdebug_proto_pair_list (log_lvl_t level, REQUEST *request, VALUE_PAIR *vp, char const *prefix) |
Print a list of protocol VALUE_PAIRs. More... | |
void | vmodule_failure_msg (REQUEST *request, char const *fmt, va_list ap) |
Add a module failure message VALUE_PAIR to the request. More... | |
Variables | |
static struct cmp * | cmp |
Valuepair functions that are radiusd-specific and as such do not belong in the library.
Definition in file pair.c.
struct cmp |
Data Fields | ||
---|---|---|
fr_dict_attr_t const * | attribute | |
RAD_COMPARE_FUNC | compare | |
bool | first_only | |
fr_dict_attr_t const * | from | |
void * | instance | |
struct cmp * | next |
void debug_pair | ( | VALUE_PAIR * | vp | ) |
void module_failure_msg | ( | REQUEST * | request, |
char const * | fmt, | ||
... | |||
) |
|
static |
See what attribute we want to compare with.
attribute | to find comparison function for. |
from | reference to compare with |
Definition at line 325 of file pair.c.
int paircompare | ( | REQUEST * | request, |
VALUE_PAIR * | req_list, | ||
VALUE_PAIR * | check, | ||
VALUE_PAIR ** | rep_list | ||
) |
Compare two pair lists except for the password information.
For every element in "check" at least one matching copy must be present in "reply".
[in] | request | Current request. |
[in] | req_list | request valuepairs. |
[in] | check | Check/control valuepairs. |
[in,out] | rep_list | Reply value pairs. |
Definition at line 479 of file pair.c.
int paircompare_register | ( | fr_dict_attr_t const * | attribute, |
fr_dict_attr_t const * | from, | ||
bool | first_only, | ||
RAD_COMPARE_FUNC | func, | ||
void * | instance | ||
) |
Register a function as compare function.
attribute | to register comparison function for. |
from | the attribute we want to compare with. Normally this is the same as attribute. If null call the comparison function on every attributes in the request if first_only is false. |
first_only | will decide if we loop over the request attributes or stop on the first one. |
func | comparison function. |
instance | argument to comparison function. |
Definition at line 395 of file pair.c.
int paircompare_register_byname | ( | char const * | name, |
fr_dict_attr_t const * | from, | ||
bool | first_only, | ||
RAD_COMPARE_FUNC | func, | ||
void * | instance | ||
) |
Register a function as compare function.
name | the attribute comparison to register |
from | the attribute we want to compare with. Normally this is the same as attribute. If null call the comparison function on every attributes in the request if first_only is false. |
first_only | will decide if we loop over the request attributes or stop on the first one. |
func | comparison function. |
instance | argument to comparison function. |
Definition at line 351 of file pair.c.
void paircompare_unregister | ( | fr_dict_attr_t const * | attribute, |
RAD_COMPARE_FUNC | func | ||
) |
void paircompare_unregister_instance | ( | void * | instance | ) |
Unregister comparison function for a module.
All paircompare() functions for this module will be unregistered.
instance | the module instance |
Definition at line 451 of file pair.c.
int radius_callback_compare | ( | REQUEST * | request, |
VALUE_PAIR * | req, | ||
VALUE_PAIR * | check, | ||
VALUE_PAIR * | check_pairs, | ||
VALUE_PAIR ** | reply_pairs | ||
) |
Compare check and vp.
May call the attribute comparison function.
Unlike radius_compare_vps() this function will call any attribute-specific comparison functions registered.
request | Current request. |
req | list pairs. |
check | item to compare. |
check_pairs | list. |
reply_pairs | list. |
Definition at line 265 of file pair.c.
int radius_compare_vps | ( | UNUSED REQUEST * | request, |
VALUE_PAIR * | check, | ||
VALUE_PAIR * | vp | ||
) |
Compares check and vp by value.
Does not call any per-attribute comparison function, but does honour check.operator. Basically does "vp.value check.op check.value".
request | Current request. |
check | rvalue, and operator. |
vp | lvalue. |
Definition at line 64 of file pair.c.
int radius_copy_vp | ( | TALLOC_CTX * | ctx, |
VALUE_PAIR ** | out, | ||
REQUEST * | request, | ||
char const * | name | ||
) |
Copy VP(s) from the specified request.
ctx | to alloc new VALUE_PAIRs in. |
out | where to write the pointer to the copied VP. Will be NULL if the attribute couldn't be resolved. |
request | current request. |
name | attribute name including qualifiers. |
Definition at line 842 of file pair.c.
int radius_find_compare | ( | fr_dict_attr_t const * | attribute | ) |
int radius_get_vp | ( | VALUE_PAIR ** | out, |
REQUEST * | request, | ||
char const * | name | ||
) |
Return a VP from the specified request.
out | where to write the pointer to the resolved VP. Will be NULL if the attribute couldn't be resolved. |
request | current request. |
name | attribute name including qualifiers. |
Definition at line 815 of file pair.c.
VALUE_PAIR* radius_pair_create | ( | TALLOC_CTX * | ctx, |
VALUE_PAIR ** | vps, | ||
unsigned int | attribute, | ||
unsigned int | vendor | ||
) |
Create a VALUE_PAIR and add it to a list of VALUE_PAIR s.
[in] | ctx | for talloc |
[out] | vps | List to add new VALUE_PAIR to, if NULL will just return VALUE_PAIR. |
[in] | attribute | number. |
[in] | vendor | number. |
Definition at line 704 of file pair.c.
int radius_xlat_do | ( | REQUEST * | request, |
VALUE_PAIR * | vp | ||
) |
Expands an attribute marked with fr_pair_mark_xlat.
Writes the new value to the vp.
request | Current request. |
vp | to expand. |
Definition at line 655 of file pair.c.
void rdebug_pair | ( | log_lvl_t | level, |
REQUEST * | request, | ||
VALUE_PAIR * | vp, | ||
char const * | prefix | ||
) |
void rdebug_pair_list | ( | log_lvl_t | level, |
REQUEST * | request, | ||
VALUE_PAIR * | vp, | ||
char const * | prefix | ||
) |
void rdebug_proto_pair_list | ( | log_lvl_t | level, |
REQUEST * | request, | ||
VALUE_PAIR * | vp, | ||
char const * | prefix | ||
) |
void vmodule_failure_msg | ( | REQUEST * | request, |
char const * | fmt, | ||
va_list | ap | ||
) |