From f6b4ac41eec72a25c703c63f43bd1104049a405c Mon Sep 17 00:00:00 2001 From: Ren Kararou Date: Tue, 31 Dec 2024 02:18:40 -0600 Subject: complete setup code; complete initial packet handling --- src/handlers.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'src/handlers.c') diff --git a/src/handlers.c b/src/handlers.c index 4162926..788934d 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -1,26 +1,27 @@ +#include #include #include "handlers.h" -void read_req_resp(nbd_nbtpd_args args) { - if (args.path[0] == 0) { +void *read_req_resp(void *args) { + if ((*(nbd_nbtpd_args *)args).path[0] == 0) { nbd_nbtpd_resp_error(args); - return; + return (void *)NULL; } - return; + return (void *)NULL; } -void write_req_resp(nbd_nbtpd_args args) { - if (args.path[0] == 0) { +void *write_req_resp(void *args) { + if ((*(nbd_nbtpd_args *)args).path[0] == 0) { nbd_nbtpd_resp_error(args); - return; + return (void *)NULL; } - return; + return (void *)NULL; } -void nbd_nbtpd_resp_error(nbd_nbtpd_args args) { - if (args.path[0] == 0) { - return; +void *nbd_nbtpd_resp_error(void *args) { + if ((*(nbd_nbtpd_args *)args).path[0] == 0) { + return (void *)NULL; } - return; + return (void *)NULL; } -- cgit 1.4.1-2-gfad0