Fix: Added uasync_t typedef, fixed pkt_normalizer queue_new calls, added utun_instance_init function
This commit is contained in:
1 parent
151e8351e4
commit
328b075ec6
3 files changed
+17
-2
No files matched your search
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user