static int dict_flag_clone(fr_dict_attr_t **da_p, char const *value, UNUSED fr_dict_flag_parser_rule_t const *rules)
{
- if (!value) {
- fr_strerror_const("Missing attribute name for 'clone=...'");
- return -1;
- }
-
if (((*da_p)->type != FR_TYPE_TLV) && ((*da_p)->type != FR_TYPE_STRUCT)) {
fr_strerror_const("'clone=...' references can only be used for 'tlv' and 'struct' types");
return -1;
* Plus, ENUMs are really just normal attributes
* in disguise.
*/
- if (!value) {
- fr_strerror_const("Missing ENUM name for 'enum=...'");
- return -1;
- }
-
if (!fr_type_is_leaf((*da_p)->type)) {
fr_strerror_const("'enum=...' references cannot be used for structural types");
return -1;
static int dict_flag_length(fr_dict_attr_t **da_p, char const *value, UNUSED fr_dict_flag_parser_rule_t const *rule)
{
fr_dict_attr_t *da = *da_p;
- if (!value) {
- fr_strerror_const("The 'length' flag requires a value");
- return -1;
- }
if (strcmp(value, "uint8") == 0) {
da->flags.extra = 1;
return -1;
}
- if (!value) {
- fr_strerror_const("The 'offset' flag requires a value");
- return -1;
- }
-
offset = atoi(value);
if ((offset <= 0) || (offset > 255)) {
fr_strerror_const("The 'offset' value must be between 1..255");
{
fr_dict_attr_t *da = *da_p;
- if (!value) {
- fr_strerror_const("Missing attribute name for 'ref=...'");
- return -1;
- }
-
if (da->flags.extra) {
fr_strerror_const("Cannot use 'ref' with other flags");
return -1;