summaryrefslogtreecommitdiff
path: root/nest/proto.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-05-30 15:31:19 +0200
committerMaria Matejka <mq@ucw.cz>2022-05-30 15:31:19 +0200
commitd7b077f5d63625beaca1bcfe971e3b853dbfcc06 (patch)
tree7d0e8d62cca65ae2dd3d5e6231657f1e43630b5a /nest/proto.c
parentd024f471ea5239a8cb6ce2ccd83b686a1d438aa5 (diff)
parent4a23ede2b056a41456790cc20a0c3d92a7137693 (diff)
Merge commit '4a23ede2b056a41456790cc20a0c3d92a7137693' into haugesund
Diffstat (limited to 'nest/proto.c')
-rw-r--r--nest/proto.c45
1 files changed, 5 insertions, 40 deletions
diff --git a/nest/proto.c b/nest/proto.c
index 09582d2e..304451cb 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); })
@@ -1757,6 +1757,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
*
@@ -1769,44 +1771,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);