]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Add dnstap io callbacks to fptr whitelist event.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 26 Feb 2020 11:14:52 +0000 (12:14 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 26 Feb 2020 11:14:52 +0000 (12:14 +0100)
dnstap/dtstream.c
dnstap/dtstream.h
util/fptr_wlist.c

index 8c51729be80c74b36b927cef1e37993a311e25b7..744e6acde38910352fa3ee2adcdcda3f26eea39e 100644 (file)
@@ -463,7 +463,7 @@ static int dtio_find_msg(struct dt_io_thread* dtio)
 }
 
 /** callback for the dnstap reconnect, to start reconnecting to output */
-static void dtio_reconnect_timeout_cb(int ATTR_UNUSED(fd),
+void dtio_reconnect_timeout_cb(int ATTR_UNUSED(fd),
        short ATTR_UNUSED(bits), void* arg)
 {
        struct dt_io_thread* dtio = (struct dt_io_thread*)arg;
@@ -1146,7 +1146,7 @@ static int dtio_ssl_handshake(struct dt_io_thread* dtio,
 #endif /* HAVE_SSL */
 
 /** callback for the dnstap events, to write to the output */
-static void dtio_output_cb(int ATTR_UNUSED(fd), short bits, void* arg)
+void dtio_output_cb(int ATTR_UNUSED(fd), short bits, void* arg)
 {
        struct dt_io_thread* dtio = (struct dt_io_thread*)arg;
        int i;
@@ -1210,7 +1210,7 @@ static void dtio_output_cb(int ATTR_UNUSED(fd), short bits, void* arg)
 }
 
 /** callback for the dnstap commandpipe, to stop the dnstap IO */
-static void dtio_cmd_cb(int fd, short ATTR_UNUSED(bits), void* arg)
+void dtio_cmd_cb(int fd, short ATTR_UNUSED(bits), void* arg)
 {
        struct dt_io_thread* dtio = (struct dt_io_thread*)arg;
        uint8_t cmd;
@@ -1349,7 +1349,7 @@ static int dtio_control_stop_send(struct stop_flush_info* info)
        return 1;
 }
 
-static void dtio_stop_timer_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(bits),
+void dtio_stop_timer_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(bits),
        void* arg)
 {
        struct stop_flush_info* info = (struct stop_flush_info*)arg;
@@ -1360,7 +1360,7 @@ static void dtio_stop_timer_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(bits),
        dtio_stop_flush_exit(info);
 }
 
-static void dtio_stop_ev_cb(int ATTR_UNUSED(fd), short bits, void* arg)
+void dtio_stop_ev_cb(int ATTR_UNUSED(fd), short bits, void* arg)
 {
        struct stop_flush_info* info = (struct stop_flush_info*)arg;
        struct dt_io_thread* dtio = info->dtio;
index 1359af7a941f297565f9e7610dd6bde53d8324a5..5bf84757af17a9a9fdeb06385e908b5d4cfa2ec5 100644 (file)
@@ -281,4 +281,19 @@ int dt_io_thread_start(struct dt_io_thread* dtio, void* event_base_nothr,
  */
 void dt_io_thread_stop(struct dt_io_thread* dtio);
 
+/** callback for the dnstap reconnect, to start reconnecting to output */
+void dtio_reconnect_timeout_cb(int fd, short bits, void* arg);
+
+/** callback for the dnstap events, to write to the output */
+void dtio_output_cb(int fd, short bits, void* arg);
+
+/** callback for the dnstap commandpipe, to stop the dnstap IO */
+void dtio_cmd_cb(int fd, short bits, void* arg);
+
+/** callback for the timer when the thread stops and wants to finish up */
+void dtio_stop_timer_cb(int fd, short bits, void* arg);
+
+/** callback for the output when the thread stops and wants to finish up */
+void dtio_stop_ev_cb(int fd, short bits, void* arg);
+
 #endif /* DTSTREAM_H */
index 84d41cc84641d0f4f52236893bf7c3351cfd7947..cf07a7aff93de2fbfba2dccbe1dd520ed88aead0 100644 (file)
@@ -93,6 +93,9 @@
 #ifdef USE_IPSET
 #include "ipset/ipset.h"
 #endif
+#ifdef USE_DNSTAP
+#include "dnstap/dtstream.h"
+#endif
 
 int 
 fptr_whitelist_comm_point(comm_point_callback_type *fptr)
@@ -168,6 +171,13 @@ fptr_whitelist_event(void (*fptr)(int, short, void *))
        else if(fptr == &tube_handle_signal) return 1;
        else if(fptr == &comm_base_handle_slow_accept) return 1;
        else if(fptr == &comm_point_http_handle_callback) return 1;
+#ifdef USE_DNSTAP
+       else if(fptr == &dtio_output_cb) return 1;
+       else if(fptr == &dtio_cmd_cb) return 1;
+       else if(fptr == &dtio_reconnect_timeout_cb) return 1;
+       else if(fptr == &dtio_stop_timer_cb) return 1;
+       else if(fptr == &dtio_stop_ev_cb) return 1;
+#endif
 #ifdef UB_ON_WINDOWS
        else if(fptr == &worker_win_stop_cb) return 1;
 #endif