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

Validation framework to allow protocols to set custom validation rules. More...

#include <freeradius-devel/util/dict_priv.h>
+ Include dependency graph for dict_validate.c:

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, _allowed)
 
#define SET_FLAG(_flag)   do { shift_ ## _flag = 1 << ++bit; if (flags->_flag) all_flags |= (1 << bit); } while (0)
 

Functions

bool dict_attr_flags_valid (fr_dict_attr_t *da)
 Validate a set of flags. More...
 
bool dict_attr_valid (fr_dict_attr_t *da)
 Validate a new attribute definition. More...
 

Detailed Description

Validation framework to allow protocols to set custom validation rules.

Definition in file dict_validate.c.

Macro Definition Documentation

◆ ALLOW_FLAG

#define ALLOW_FLAG (   _flag)    do { all_flags &= ~shift_ ## _flag; } while (0)

◆ FORBID_OTHER_FLAGS

#define FORBID_OTHER_FLAGS (   _flag,
  _allowed 
)
Value:
do { \
if (all_flags & ~shift_ ## _flag & ~(_allowed)) { \
fr_strerror_printf("The '" STRINGIFY(_flag) "' flag cannot be used with any other flag (%u) %s[%u]", all_flags, da->filename, da->line); \
return false; \
} \
} while (0)
#define STRINGIFY(x)
Definition: build.h:195

◆ SET_FLAG

#define SET_FLAG (   _flag)    do { shift_ ## _flag = 1 << ++bit; if (flags->_flag) all_flags |= (1 << bit); } while (0)

Function Documentation

◆ dict_attr_flags_valid()

bool dict_attr_flags_valid ( fr_dict_attr_t da)

Validate a set of flags.

Parameters
[in]dato check.
Returns
  • true if attribute definition is valid.
  • false if attribute definition is not valid.

Definition at line 35 of file dict_validate.c.

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

◆ dict_attr_valid()

bool dict_attr_valid ( fr_dict_attr_t da)

Validate a new attribute definition.

Todo:
we need to check length of none vendor attributes.
Parameters
[in]dato validate.
Returns
  • true if attribute definition is valid.
  • false if attribute definition is not valid.

Definition at line 603 of file dict_validate.c.

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