FLAG_KEY_FIELD, //!< this is a key field for a subsequent struct
FLAG_BIT_FIELD, //!< bit field inside of a struct
FLAG_LENGTH_UINT16, //!< string / octets type is prefixed by uint16 of length
- FLAG_HAS_REF, //!< the attribute has a reference to somewhere else
};
#define fr_dict_attr_is_key_field(_da) ((_da)->flags.extra && ((_da)->flags.subtype == FLAG_KEY_FIELD))
}
*ref = talloc_strdup(ctx->fixup.pool, value);
- flags->extra = true;
- flags->subtype = FLAG_HAS_REF;
} else if (strcmp(key, "clone") == 0) {
if (!value) {
*/
if (flags->extra) {
if ((flags->subtype != FLAG_KEY_FIELD) && (flags->subtype != FLAG_LENGTH_UINT16) &&
- (flags->subtype != FLAG_BIT_FIELD) && (flags->subtype != FLAG_HAS_REF)) {
+ (flags->subtype != FLAG_BIT_FIELD)) {
fr_strerror_const("The 'key' and 'length' flags cannot be used with any other flags.");
return false;
}
break;
case FR_TYPE_TLV:
- if (flags->subtype != FLAG_HAS_REF) {
- fr_strerror_const("Invalid type for extra flag.");
- return false;
- }
-
ALLOW_FLAG(extra);
/* @todo - allow arrays of struct? */
ALLOW_FLAG(subtype);
return false;
}
- if (flags->subtype == FLAG_HAS_REF) {
- if ((type != FR_TYPE_GROUP) && (type != FR_TYPE_TLV) && (type != FR_TYPE_STRUCT)) {
- fr_strerror_printf("The 'ref' flag cannot be used used with type %s",
- fr_table_str_by_value(fr_value_box_type_table, type, "<UNKNOWN>"));
- return false;
- }
-
- /*
- * @todo - double-check refs here, and not in dict_read_process_attribute().
- */
- }
-
FORBID_OTHER_FLAGS(extra);
}
* with refs. It shouldn't appear anywhere else.
*/
if (flags->extra) {
- if (flags->subtype != FLAG_HAS_REF) {
- fr_strerror_const("Unsupported extension.");
- return false;
- }
-
- return true;
+ fr_strerror_const("Unsupported extension.");
+ return false;
}
if (flags->subtype > FLAG_ENCRYPT_ASCEND_SECRET) {