diff options
author | Maria Matejka <mq@ucw.cz> | 2023-04-19 21:18:12 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2023-04-22 20:48:42 +0200 |
commit | 074739e0e9baaba53f2a99edd348b76c3613b455 (patch) | |
tree | cf2402e373ec0909a76c0d05347a23385b339f1e /nest/protocol.h | |
parent | 48dfcb60d61ab7aec478468bd50eb0196c332ee3 (diff) |
Global protocol list is typed to avoid typecast confusion
Diffstat (limited to 'nest/protocol.h')
-rw-r--r-- | nest/protocol.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/nest/protocol.h b/nest/protocol.h index 01153162..eccfcb73 100644 --- a/nest/protocol.h +++ b/nest/protocol.h @@ -116,9 +116,16 @@ struct proto_config { /* Protocol-specific data follow... */ }; +#define TLIST_PREFIX proto +#define TLIST_TYPE struct proto +#define TLIST_ITEM n +#define TLIST_WANT_WALK +#define TLIST_WANT_ADD_TAIL +#define TLIST_WANT_ADD_AFTER + /* Protocol statistics */ struct proto { - node n; /* Node in global proto_list */ + TLIST_DEFAULT_NODE; /* Node in global proto_list */ struct protocol *proto; /* Protocol */ struct proto_config *cf; /* Configuration data */ struct proto_config *cf_new; /* Configuration we want to switch to after shutdown (NULL=delete) */ @@ -198,6 +205,8 @@ struct proto { /* Hic sunt protocol-specific data */ }; +#include "lib/tlists.h" + struct proto_spec { const void *ptr; int patt; @@ -284,7 +293,6 @@ proto_get_router_id(struct proto_config *pc) extern pool *proto_pool; -extern list proto_list; /* * Each protocol instance runs two different state machines: |