]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Add libunbound/remote.h (#1465)
authorDag-Erling Smørgrav <des@des.no>
Thu, 25 Jun 2026 09:14:37 +0000 (11:14 +0200)
committerGitHub <noreply@github.com>
Thu, 25 Jun 2026 09:14:37 +0000 (11:14 +0200)
Add a shared header containing prototypes for functions that both ends
of a remote control connection need to implement.

daemon/remote.h
libunbound/remote.h [new file with mode: 0644]
libunbound/worker.h
smallapp/worker_cb.c

index e9c392fd819e1ba2dfcbd0c9df14f8db6200d3ac..7e1f3c2422b0a78cc5ee5b2866063f5ffc042f6e 100644 (file)
@@ -49,6 +49,7 @@
 #include <openssl/ssl.h>
 #endif
 #include "util/locks.h"
+#include "libunbound/remote.h"
 struct config_file;
 struct listen_list;
 struct listen_port;
@@ -365,13 +366,6 @@ void fast_reload_thread_start(RES* ssl, struct worker* worker,
  */
 void fast_reload_thread_stop(struct fast_reload_thread* fast_reload_thread);
 
-/** fast reload thread commands to remote service thread event callback */
-void fast_reload_service_cb(int fd, short bits, void* arg);
-
-/** fast reload callback for the remote control client connection */
-int fast_reload_client_callback(struct comm_point* c, void* arg, int err,
-       struct comm_reply* rep);
-
 /** fast reload printq delete list */
 void fast_reload_printq_list_delete(struct fast_reload_printq* list);
 
diff --git a/libunbound/remote.h b/libunbound/remote.h
new file mode 100644 (file)
index 0000000..4730c8e
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * libunbound/remote.h - prototypes for remote control methods.
+ *
+ * Copyright (c) 2026, NLnet Labs. All rights reserved.
+ *
+ * This software is open source.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * 
+ * Neither the name of the NLNET LABS nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * \file
+ *
+ * This file declares the methods that must be implemented to use the
+ * remote control service.
+ */
+
+#ifndef LIBUNBOUND_REMOTE_H
+#define LIBUNBOUND_REMOTE_H
+
+struct comm_reply;
+struct comm_point;
+
+/** fast reload thread commands to remote service thread event callback */
+void fast_reload_service_cb(int fd, short bits, void* arg);
+
+/** fast reload callback for the remote control client connection */
+int fast_reload_client_callback(struct comm_point* c, void* arg, int err,
+       struct comm_reply* rep);
+
+/** handle remote control accept callbacks */
+int remote_accept_callback(struct comm_point*, void*, int, struct comm_reply*);
+
+/** handle remote control data callbacks */
+int remote_control_callback(struct comm_point*, void*, int, struct comm_reply*);
+
+/** routine to printout option values over SSL */
+void  remote_get_opt_ssl(char* line, void* arg);
+
+#endif /* LIBUNBOUND_REMOTE_H */
index 9ca4b2d96f6fe1a9e2b38d4677f7580d9088f23e..48f9ee15be170495234200b094729c8606071dbb 100644 (file)
@@ -177,13 +177,4 @@ void worker_start_accept(void* arg);
 /** stop accept callback handler */
 void worker_stop_accept(void* arg);
 
-/** handle remote control accept callbacks */
-int remote_accept_callback(struct comm_point*, void*, int, struct comm_reply*);
-
-/** handle remote control data callbacks */
-int remote_control_callback(struct comm_point*, void*, int, struct comm_reply*);
-
-/** routine to printout option values over SSL */
-void  remote_get_opt_ssl(char* line, void* arg);
-
 #endif /* LIBUNBOUND_WORKER_H */
index 9807aac8ef3f0d13804f0c72be3609f1e7aa7adf..1a191be50ff5a7b4d3f9990f62dbb6bcbf1ceaf5 100644 (file)
@@ -43,6 +43,7 @@
 #include "config.h"
 #include "libunbound/context.h"
 #include "libunbound/worker.h"
+#include "libunbound/remote.h"
 #include "util/fptr_wlist.h"
 #include "util/log.h"
 #include "services/mesh.h"