tor_multipath_voip/src/algo_skel.h

40 lines
850 B
C
Raw Normal View History

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>
#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"
#include "url.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-03-19 09:00:03 +00:00
typedef void (*algo_init)(struct evt_core_ctx* ctx, struct algo_skel* as);
2019-02-13 14:32:38 +00:00
2019-03-19 09:00:03 +00:00
void init_algo(struct evt_core_ctx* ctx, struct algo_skel* as, char* name);
void algo_naive(struct evt_core_ctx* ctx, struct algo_skel* as);
2019-03-19 16:09:42 +00:00
void algo_rr(struct evt_core_ctx* ctx, 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"
2019-03-19 16:09:42 +00:00
},
{
.init = algo_rr,
.name = "rr"
2019-02-13 14:32:38 +00:00
}
};