Browse Source

Fix: Added uasync_t typedef, fixed pkt_normalizer queue_new calls, added utun_instance_init function

v2_dev
Evgeny 2 months ago
parent
commit
4db35615e4
  1. 4
      lib/u_async.h
  2. 4
      src/pkt_normalizer.c
  3. 11
      src/utun_instance.c

4
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);

4
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);

11
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;
}

Loading…
Cancel
Save