security communication with openssl and simplify netio
This commit is contained in:
parent
2a7b7c39bb
commit
8f796b3109
20 changed files with 1176 additions and 922 deletions
|
|
@ -12,15 +12,26 @@
|
|||
|
||||
typedef int (*vtask_func_t)(void*);
|
||||
|
||||
#define VTASK_IO 0x01
|
||||
#define VTASK_GENERIC 0x02
|
||||
|
||||
typedef struct {
|
||||
void* owner;
|
||||
ioctx_t ctx;
|
||||
int vcpu;
|
||||
vtask_func_t entry;
|
||||
int vtype;
|
||||
union {
|
||||
void* generic;
|
||||
io_task_data_t iodata;
|
||||
} u;
|
||||
} vtask_data_t;
|
||||
|
||||
typedef struct {
|
||||
data_item_t link;
|
||||
void* owner;
|
||||
vtask_data_t* data;
|
||||
int vcpu;
|
||||
vtask_func_t entry;
|
||||
} vtask_t;
|
||||
|
||||
#define ITPTR_TO_VTASK(p) \
|
||||
((vtask_t*)(((char*)p) - offsetof(ioctx_t, link) - offsetof(vtask_t, ctx)))
|
||||
#define ITPTR_TO_VTASK(p) ((vtask_t*)(((char*)p) - offsetof(vtask_t, link)))
|
||||
|
||||
typedef enum {
|
||||
VCPU_IDLE = 0,
|
||||
|
|
@ -47,10 +58,11 @@ typedef struct {
|
|||
} vtaskmgr_t;
|
||||
|
||||
extern vtask_t* vtask_alloc();
|
||||
extern int vtask_init(vtask_t*, vtask_func_t, endpoint_t*);
|
||||
extern int vtask_init(vtask_t*, vtask_func_t, void*);
|
||||
extern void vtask_fini(vtask_t*);
|
||||
|
||||
extern int vtask_enq(vtaskmgr_t*, vtask_t*);
|
||||
extern int vtask_handle_msg(vtaskmgr_t*, vtask_func_t, void* arg);
|
||||
|
||||
extern int vtaskmgr_init(vtaskmgr_t*, int);
|
||||
extern int vtaskmgr_start(vtaskmgr_t*);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue