diff options
author | Maria Matejka <mq@ucw.cz> | 2022-03-18 22:05:50 +0100 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-04-06 18:14:08 +0200 |
commit | 4a23ede2b056a41456790cc20a0c3d92a7137693 (patch) | |
tree | 179c6f0ae13604cb85e9f10729818ef0b131e9a1 /nest/proto.c | |
parent | 0f68515263e91dd49b2d845cdff35af40c064dc2 (diff) |
Protocols have their own explicit init routines
Diffstat (limited to 'nest/proto.c')
-rw-r--r-- | nest/proto.c | 45 |
1 files changed, 5 insertions, 40 deletions
diff --git a/nest/proto.c b/nest/proto.c index 7cfb1555..7074f73a 100644 --- a/nest/proto.c +++ b/nest/proto.c @@ -23,9 +23,9 @@ #include "filter/f-inst.h" pool *proto_pool; -list proto_list; +list STATIC_LIST_INIT(proto_list); -static list protocol_list; +static list STATIC_LIST_INIT(protocol_list); struct protocol *class_to_protocol[PROTOCOL__MAX]; #define CD(c, msg, args...) ({ if (c->debug & D_STATES) log(L_TRACE "%s.%s: " msg, c->proto->name, c->name ?: "?", ## args); }) @@ -1651,6 +1651,8 @@ proto_build(struct protocol *p) /* FIXME: convert this call to some protocol hook */ extern void bfd_init_all(void); +void protos_build_gen(void); + /** * protos_build - build a protocol list * @@ -1663,44 +1665,7 @@ extern void bfd_init_all(void); void protos_build(void) { - init_list(&proto_list); - init_list(&protocol_list); - - proto_build(&proto_device); -#ifdef CONFIG_RADV - proto_build(&proto_radv); -#endif -#ifdef CONFIG_RIP - proto_build(&proto_rip); -#endif -#ifdef CONFIG_STATIC - proto_build(&proto_static); -#endif -#ifdef CONFIG_MRT - proto_build(&proto_mrt); -#endif -#ifdef CONFIG_OSPF - proto_build(&proto_ospf); -#endif -#ifdef CONFIG_PIPE - proto_build(&proto_pipe); -#endif -#ifdef CONFIG_BGP - proto_build(&proto_bgp); -#endif -#ifdef CONFIG_BFD - proto_build(&proto_bfd); - bfd_init_all(); -#endif -#ifdef CONFIG_BABEL - proto_build(&proto_babel); -#endif -#ifdef CONFIG_RPKI - proto_build(&proto_rpki); -#endif -#ifdef CONFIG_PERF - proto_build(&proto_perf); -#endif + protos_build_gen(); proto_pool = rp_new(&root_pool, "Protocols"); proto_shutdown_timer = tm_new(proto_pool); |