From 6fcc801b71ec034cc6abb1d19323cd0355d657cd Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 29 Aug 2016 11:53:43 +0000 Subject: [PATCH] -starting with service_new implementation data structures --- src/util/service_new.c | 44 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/util/service_new.c b/src/util/service_new.c index 953d3a8be..68988069f 100644 --- a/src/util/service_new.c +++ b/src/util/service_new.c @@ -30,6 +30,40 @@ #include "gnunet_resolver_service.h" +/** + * Information the service tracks per listen operation. + */ +struct ServiceListenContext +{ + + /** + * Kept in a DLL. + */ + struct ServiceListenContext *next; + + /** + * Kept in a DLL. + */ + struct ServiceListenContext *prev; + + /** + * Service this listen context belongs to. + */ + struct GNUNET_SERVICE_Handle *sh; + + /** + * Socket we are listening on. + */ + struct GNUNET_NETWORK_Handle *listen_socket; + + /** + * Task scheduled to do the listening. + */ + struct GNUNET_SCHEDULER_Task *listen_task; + +}; + + /** * Handle to a service. */ @@ -65,6 +99,16 @@ struct GNUNET_SERVICE_Handle */ void *cb_cls; + /** + * DLL of listen sockets used to accept new connections. + */ + struct ServiceListenContext *slc_head; + + /** + * DLL of listen sockets used to accept new connections. + */ + struct ServiceListenContext *slc_tail; + /** * Message handlers to use for all clients. */ -- 2.25.1