From: Jeremy Allison Date: Fri, 23 Sep 2016 19:18:37 +0000 (-0700) Subject: s3: nmbd: Add (currently unused) timeout and fd handlers. X-Git-Tag: samba-4.3.12~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=928f2814e80e3794b39b7e830f9fd25fe161e86a;p=thirdparty%2Fsamba.git s3: nmbd: Add (currently unused) timeout and fd handlers. This will allow us to eventually remove source3/lib/events.c dependency and make nmbd purely tevent based. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12283 Signed-off-by: Jeremy Allison Reviewed-by: Volker Lendecke (cherry picked from commit cca25c8f75147873280464eaf2699ff449f609ad) --- diff --git a/source3/nmbd/nmbd_packets.c b/source3/nmbd/nmbd_packets.c index 77add59bdee..bfb2dd708cd 100644 --- a/source3/nmbd/nmbd_packets.c +++ b/source3/nmbd/nmbd_packets.c @@ -1871,6 +1871,32 @@ static void free_processed_packet_list(struct processed_packet **pp_processed_pa } } +/**************************************************************************** + Timeout callback - just notice we timed out. +***************************************************************************/ + +static void nmbd_timeout_handler(struct tevent_context *ev, + struct tevent_timer *te, + struct timeval current_time, + void *private_data) +{ + bool *got_timeout = private_data; + *got_timeout = true; +} + +/**************************************************************************** + fd callback - remember the fd that triggered. +***************************************************************************/ + +static void nmbd_fd_handler(struct tevent_context *ev, + struct tevent_fd *fde, + uint16_t flags, + void *private_data) +{ + struct socket_attributes *attr = private_data; + attr->triggered = true; +} + /**************************************************************************** Listens for NMB or DGRAM packets, and queues them. return True if the socket is dead