From da76459dc21b5af2449af2d36eb95226cb186ce2 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 11:35:11 +0200 Subject: Adding upstream version 2.6.12. Signed-off-by: Daniel Baumann --- src/dgram.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/dgram.c (limited to 'src/dgram.c') diff --git a/src/dgram.c b/src/dgram.c new file mode 100644 index 0000000..54823d1 --- /dev/null +++ b/src/dgram.c @@ -0,0 +1,30 @@ +/* + * Datagram processing functions + * + * Copyright 2014 Baptiste Assmann + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + */ + +#include +#include + +/* datagram handler callback */ +void dgram_fd_handler(int fd) +{ + struct dgram_conn *dgram = fdtab[fd].owner; + + if (unlikely(!dgram)) + return; + + if (fd_recv_ready(fd)) + dgram->data->recv(dgram); + if (fd_send_ready(fd)) + dgram->data->send(dgram); + + return; +} -- cgit v1.2.3