diff --git a/lib/u_async.h b/lib/u_async.h index c207373d4..4bf54a953 100644 --- a/lib/u_async.h +++ b/lib/u_async.h @@ -33,6 +33,10 @@ struct UASYNC { int wakeup_initialized; }; +// Type definitions +typedef struct UASYNC uasync_t; +typedef struct UASYNC UASYNC_t; + // Instance API - основной API для работы с uasync struct UASYNC* uasync_create(void); void uasync_destroy(struct UASYNC* ua); diff --git a/src/pkt_normalizer.c b/src/pkt_normalizer.c index 6a0f0a992..cfc1cfc26 100644 --- a/src/pkt_normalizer.c +++ b/src/pkt_normalizer.c @@ -13,12 +13,12 @@ struct pn_struct* pkt_normalizer_init(uasync_t* ua, int is_packer, int mtu) { struct pn_struct* pn = malloc(sizeof(struct pn_struct)); if (!pn) return NULL; pn->ua = ua; - pn->input = queue_new(ua); + pn->input = queue_new(ua, NULL); // No memory pool for now if (!pn->input) { free(pn); return NULL; } - pn->output = queue_new(ua); + pn->output = queue_new(ua, NULL); // No memory pool for now if (!pn->output) { queue_free(pn->input); free(pn); diff --git a/src/utun_instance.c b/src/utun_instance.c index f9b4ff124..c4f7614a8 100644 --- a/src/utun_instance.c +++ b/src/utun_instance.c @@ -163,3 +163,14 @@ void utun_instance_stop(struct UTUN_INSTANCE *instance) { } + +int utun_instance_init(struct UTUN_INSTANCE *instance) { + if (!instance) return -1; + + // Initialize connections + if (init_connections(instance) < 0) { + return -1; + } + + return 0; +}