2019-02-11 21:40:00 +00:00
|
|
|
#pragma once
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <errno.h>
|
2019-02-13 14:32:38 +00:00
|
|
|
#include <string.h>
|
2019-02-14 12:50:43 +00:00
|
|
|
#include "packet.h"
|
2019-02-11 21:40:00 +00:00
|
|
|
#include "evt_core.h"
|
2019-02-12 10:17:37 +00:00
|
|
|
#include "utils.h"
|
2019-02-11 21:40:00 +00:00
|
|
|
|
|
|
|
struct algo_skel {
|
2019-02-12 10:17:37 +00:00
|
|
|
struct evt_core_cat on_udp_read;
|
|
|
|
struct evt_core_cat on_tcp_read;
|
|
|
|
struct evt_core_cat on_udp_write;
|
|
|
|
struct evt_core_cat on_tcp_write;
|
2019-02-11 21:40:00 +00:00
|
|
|
struct evt_core_cat on_tcp_co;
|
|
|
|
};
|
|
|
|
|
2019-02-13 14:32:38 +00:00
|
|
|
typedef void (*algo_init)(struct algo_skel* as);
|
|
|
|
|
|
|
|
void init_algo(struct algo_skel* as, char* name);
|
2019-02-11 21:40:00 +00:00
|
|
|
void algo_naive(struct algo_skel* as);
|
2019-02-13 14:32:38 +00:00
|
|
|
|
|
|
|
struct algo_desc {
|
|
|
|
algo_init init;
|
|
|
|
char* name;
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct algo_desc available_algo[] = {
|
|
|
|
{
|
|
|
|
.init = algo_naive,
|
|
|
|
.name = "naive"
|
|
|
|
}
|
|
|
|
};
|