The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Validation framework to allow protocols to set custom validation rules. More...
#include <freeradius-devel/util/dict_priv.h>
Go to the source code of this file.
Macros | |
#define | ALLOW_FLAG(_flag) do { all_flags &= ~shift_ ## _flag; } while (0) |
#define | FORBID_OTHER_FLAGS(_flag) do { if (all_flags & ~shift_ ## _flag) { fr_strerror_printf("The '" STRINGIFY(_flag) "' flag cannot be used with any other flag"); return false; } } while (0) |
#define | SET_FLAG(_flag) do { shift_ ## _flag = 1 << ++bit; if (flags->_flag) all_flags |= (1 << bit); } while (0) |
Functions | |
bool | dict_attr_fields_valid (fr_dict_t *dict, fr_dict_attr_t const *parent, char const *name, int *attr, fr_type_t type, fr_dict_attr_flags_t *flags) |
Validate a new attribute definition. More... | |
bool | dict_attr_flags_valid (fr_dict_t *dict, fr_dict_attr_t const *parent, char const *name, int *attr, fr_type_t type, fr_dict_attr_flags_t *flags) |
Validate a set of flags. More... | |
Validation framework to allow protocols to set custom validation rules.
Definition in file dict_validate.c.
#define FORBID_OTHER_FLAGS | ( | _flag | ) | do { if (all_flags & ~shift_ ## _flag) { fr_strerror_printf("The '" STRINGIFY(_flag) "' flag cannot be used with any other flag"); return false; } } while (0) |
#define SET_FLAG | ( | _flag | ) | do { shift_ ## _flag = 1 << ++bit; if (flags->_flag) all_flags |= (1 << bit); } while (0) |
bool dict_attr_fields_valid | ( | fr_dict_t * | dict, |
fr_dict_attr_t const * | parent, | ||
char const * | name, | ||
int * | attr, | ||
fr_type_t | type, | ||
fr_dict_attr_flags_t * | flags | ||
) |
Validate a new attribute definition.
[in] | dict | of protocol context we're operating in. If NULL the internal dictionary will be used. |
[in] | parent | to add attribute under. |
[in] | name | of the attribute. |
[in] | attr | number. |
[in] | type | of attribute. |
[in] | flags | to set in the attribute. |
Definition at line 599 of file dict_validate.c.
bool dict_attr_flags_valid | ( | fr_dict_t * | dict, |
fr_dict_attr_t const * | parent, | ||
char const * | name, | ||
int * | attr, | ||
fr_type_t | type, | ||
fr_dict_attr_flags_t * | flags | ||
) |
Validate a set of flags.
[in] | dict | of protocol context we're operating in. If NULL the internal dictionary will be used. |
[in] | parent | to add attribute under. |
[in] | name | of the attribute. |
[in] | attr | number. |
[in] | type | of attribute. |
[in] | flags | to check in the attribute. |
Definition at line 40 of file dict_validate.c.