summaryrefslogtreecommitdiff
path: root/source3/nmbd/nmbd_packets.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2016-09-23 12:18:37 -0700
committerVolker Lendecke <vl@samba.org>2016-09-24 19:52:08 +0200
commitcca25c8f75147873280464eaf2699ff449f609ad (patch)
treed89633f329503889d97c9bdbd3e2e1c010f53a2a /source3/nmbd/nmbd_packets.c
parent376e04656b6755d1a182430b39273a93495d00b2 (diff)
downloadsamba-cca25c8f75147873280464eaf2699ff449f609ad.tar.gz
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 <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3/nmbd/nmbd_packets.c')
-rw-r--r--source3/nmbd/nmbd_packets.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/source3/nmbd/nmbd_packets.c b/source3/nmbd/nmbd_packets.c
index 73219223834..caef1db3785 100644
--- a/source3/nmbd/nmbd_packets.c
+++ b/source3/nmbd/nmbd_packets.c
@@ -1872,6 +1872,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
***************************************************************************/