From: Michael Tremer Date: Mon, 11 May 2026 09:13:28 +0000 (+0000) Subject: main: Create a new network manager X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fc86bb6a667a1a2d49595ed413370e96f9304db8;p=zone-sync.git main: Create a new network manager Signed-off-by: Michael Tremer --- diff --git a/main.c b/main.c index beb9b5a..4dbaf42 100644 --- a/main.c +++ b/main.c @@ -26,6 +26,7 @@ #include #include +#include typedef struct ctx { int log_level; @@ -35,6 +36,9 @@ typedef struct ctx { // Loop Manager isc_loopmgr_t* loopmgr; + + // Network Manager + isc_nm_t* netmgr; } ctx_t; static void logger(ctx_t* ctx, int priority, const char* format, ...) { @@ -142,6 +146,9 @@ int main(int argc, char* argv[]) { // Initialize the loop manager isc_loopmgr_create(ctx.memctx, 1, &ctx.loopmgr); + // Create a new netmgr + isc_netmgr_create(ctx.memctx, ctx.loopmgr, &ctx.netmgr); + // Register a callback to be called when the loop starts isc_loopmgr_setup(ctx.loopmgr, run_loop, &ctx); @@ -149,6 +156,7 @@ int main(int argc, char* argv[]) { isc_loopmgr_run(ctx.loopmgr); ERROR: + isc_netmgr_destroy(&ctx.netmgr); isc_loopmgr_destroy(&ctx.loopmgr); return 0;