summaryrefslogtreecommitdiffstats
path: root/src/shared/varlink.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-04-05 16:03:38 +0200
committerLennart Poettering <lennart@poettering.net>2023-04-12 15:14:21 +0200
commitd37cdac6cef5856b3839558308f7e7ab27979c83 (patch)
tree5e678c3400f1f6152b206e86d0ece6bca8a30c6d /src/shared/varlink.h
parentvarlink: add helper that clears the currently processed incoming message JSON... (diff)
downloadsystemd-d37cdac6cef5856b3839558308f7e7ab27979c83.tar.xz
systemd-d37cdac6cef5856b3839558308f7e7ab27979c83.zip
varlink: implement file descriptor passing
Let's add infrastructure to implement fd passing in varlink, when used over AF_UNIX. This will optionally associate one or more fds with a message sent via varlink and deliver it to the server.
Diffstat (limited to 'src/shared/varlink.h')
-rw-r--r--src/shared/varlink.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/shared/varlink.h b/src/shared/varlink.h
index ea4e23ff9c..a94f5a7729 100644
--- a/src/shared/varlink.h
+++ b/src/shared/varlink.h
@@ -107,6 +107,18 @@ int varlink_error_errno(Varlink *v, int error);
int varlink_notify(Varlink *v, JsonVariant *parameters);
int varlink_notifyb(Varlink *v, ...);
+/* Write outgoing fds into the socket (to be associated with the next enqueued message) */
+int varlink_push_fd(Varlink *v, int fd);
+int varlink_dup_fd(Varlink *v, int fd);
+int varlink_reset_fds(Varlink *v);
+
+/* Read incoming fds from the socket (associated with the currently handled message) */
+int varlink_peek_fd(Varlink *v, size_t i);
+int varlink_take_fd(Varlink *v, size_t i);
+
+int varlink_set_allow_fd_passing_input(Varlink *v, bool b);
+int varlink_set_allow_fd_passing_output(Varlink *v, bool b);
+
/* Bind a disconnect, reply or timeout callback */
int varlink_bind_reply(Varlink *v, VarlinkReply reply);