summaryrefslogtreecommitdiff
path: root/nest/proto.c
diff options
context:
space:
mode:
authorJan Maria Matejka <mq@ucw.cz>2018-05-07 14:47:00 +0200
committerJan Maria Matejka <mq@ucw.cz>2018-05-29 12:35:06 +0200
commitee7e2ffd265fd76dbc8c94d9c2d48da54c27ff76 (patch)
tree7460254b1bd105e5bc45937e2e00aaac7da4ccf7 /nest/proto.c
parentc3becfe1934da2dc2c0881a71eac8a26f810791f (diff)
Protocol: Introducing an enum protocol_class
This supersedes the EAP_* constants.
Diffstat (limited to 'nest/proto.c')
-rw-r--r--nest/proto.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/nest/proto.c b/nest/proto.c
index 15d6f4de..49f71304 100644
--- a/nest/proto.c
+++ b/nest/proto.c
@@ -25,6 +25,7 @@ pool *proto_pool;
list proto_list;
static list protocol_list;
+struct protocol *class_to_protocol[PROTOCOL__MAX];
#define PD(pr, msg, args...) do { if (pr->debug & D_STATES) { log(L_TRACE "%s: " msg, pr->name , ## args); } } while(0)
@@ -1256,11 +1257,9 @@ void
proto_build(struct protocol *p)
{
add_tail(&protocol_list, &p->n);
- if (p->attr_class)
- {
- ASSERT(!attr_class_to_protocol[p->attr_class]);
- attr_class_to_protocol[p->attr_class] = p;
- }
+ ASSERT(p->class);
+ ASSERT(!class_to_protocol[p->class]);
+ class_to_protocol[p->class] = p;
}
/* FIXME: convert this call to some protocol hook */