Dropping EAF_TYPE__MAX and adding a check for forgotten
ea class registration
{
struct eattr *a;
- if (da->type >= EAF_TYPE__MAX)
- bug("Unsupported attribute type");
-
switch (da->type) {
case T_IFACE:
case T_OPAQUE:
static inline eattr *
ea_set_attr(ea_list **to, eattr a)
{
+ if (!a.id)
+ bug("You have forgotten to register your EA class");
+
EA_LOCAL_LIST(1) *ea = tmp_alloc(sizeof(*ea));
*ea = (typeof(*ea)) {
.l.flags = EALF_SORTED,
T_ENUM_RA_PREFERENCE = 0x15, /* RA Preference enum */
T_ENUM_FLOWSPEC_VALID = 0x17, /* Flowspec validation result */
-#define EAF_TYPE__MAX 0x1f
#define EAF_EMBEDDED 0x01 /* Data stored in eattr.u.data (part of type spec) */
/* Otherwise, attribute data is adata */