From 260e1810ba5e70a173f8bac7643188b034f59980 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 6 May 2019 14:23:14 +0200 Subject: [PATCH] Link dup2 to proxy --- src/proxy.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/proxy.h b/src/proxy.h index bd0420c..1a9d2d8 100644 --- a/src/proxy.h +++ b/src/proxy.h @@ -22,6 +22,12 @@ int algo_rr_on_datagram(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo int algo_rr_on_timer(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo); int algo_rr_on_err(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo); +void algo_dup2_init(struct evt_core_ctx* ctx, struct algo_ctx* app_ctx, struct algo_params* ap); +int algo_dup2_on_stream(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo, struct buffer_packet* bp); +int algo_dup2_on_datagram(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo, struct buffer_packet* bp); +int algo_dup2_on_timer(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo); +int algo_dup2_on_err(struct evt_core_ctx *ctx, struct evt_core_fdinfo *fdinfo); + static struct algo_desc available_algo[] = { { .name = "naive", @@ -41,11 +47,11 @@ static struct algo_desc available_algo[] = { }, { .name = "dup2", - .init = NULL, - .on_stream = NULL, - .on_datagram = NULL, - .on_timer = NULL, - .on_err = NULL + .init = algo_dup2_init, + .on_stream = algo_dup2_on_stream, + .on_datagram = algo_dup2_on_datagram, + .on_timer = algo_dup2_on_timer, + .on_err = algo_dup2_on_err } };