diff options
author | Maria Matejka <mq@ucw.cz> | 2023-04-24 10:39:13 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2023-04-24 10:39:13 +0200 |
commit | fa8848aca3f0473412f3ae6288d71dee8458bcfa (patch) | |
tree | 20aa1c64f866079684f4923f857021baff4d2b53 /nest/protocol.h | |
parent | 942d3cbcdd548a73ecc1915a97e297e9bf0bb5e6 (diff) | |
parent | 22f54eaee6c6dbe12ad7bb0ee1da09e3e026b970 (diff) |
Merge branch 'mq-resource-locking' into thread-next
Diffstat (limited to 'nest/protocol.h')
-rw-r--r-- | nest/protocol.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/nest/protocol.h b/nest/protocol.h index 01153162..02ec5c15 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; @@ -271,6 +280,8 @@ struct proto *proto_iterate_named(struct symbol *sym, struct protocol *proto, st #define PROTO_LOCKED_FROM_MAIN(p) for (struct birdloop *_proto_loop = PROTO_ENTER_FROM_MAIN(p); _proto_loop; PROTO_LEAVE_FROM_MAIN(_proto_loop), (_proto_loop = NULL)) +static inline struct domain_generic *proto_domain(struct proto *p) +{ return birdloop_domain(p->loop); } #define CMD_RELOAD 0 #define CMD_RELOAD_IN 1 @@ -284,7 +295,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: |