mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-03-11 17:08:46 +00:00
Attributes: cleanup
Dropping EAF_TYPE__MAX and adding a check for forgotten ea class registration
This commit is contained in:
parent
bf961ba405
commit
602595fe10
@ -907,9 +907,6 @@
|
|||||||
{
|
{
|
||||||
struct eattr *a;
|
struct eattr *a;
|
||||||
|
|
||||||
if (da->type >= EAF_TYPE__MAX)
|
|
||||||
bug("Unsupported attribute type");
|
|
||||||
|
|
||||||
switch (da->type) {
|
switch (da->type) {
|
||||||
case T_IFACE:
|
case T_IFACE:
|
||||||
case T_OPAQUE:
|
case T_OPAQUE:
|
||||||
|
@ -380,6 +380,9 @@ void ea_list_copy(ea_list *dest, ea_list *src, uint size);
|
|||||||
static inline eattr *
|
static inline eattr *
|
||||||
ea_set_attr(ea_list **to, eattr a)
|
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_LOCAL_LIST(1) *ea = tmp_alloc(sizeof(*ea));
|
||||||
*ea = (typeof(*ea)) {
|
*ea = (typeof(*ea)) {
|
||||||
.l.flags = EALF_SORTED,
|
.l.flags = EALF_SORTED,
|
||||||
|
@ -78,7 +78,6 @@ enum btype {
|
|||||||
T_ENUM_RA_PREFERENCE = 0x15, /* RA Preference enum */
|
T_ENUM_RA_PREFERENCE = 0x15, /* RA Preference enum */
|
||||||
T_ENUM_FLOWSPEC_VALID = 0x17, /* Flowspec validation result */
|
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) */
|
#define EAF_EMBEDDED 0x01 /* Data stored in eattr.u.data (part of type spec) */
|
||||||
/* Otherwise, attribute data is adata */
|
/* Otherwise, attribute data is adata */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user