summaryrefslogtreecommitdiffstats
path: root/src/shared/varlink-io.systemd.service.c
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2023-10-30 10:42:17 +0100
committerDavid Tardon <dtardon@redhat.com>2023-10-31 12:49:17 +0100
commitca46756cd80d34fac3f8ce9b3b126e537b09112f (patch)
tree67cadf2d7eb5f43b9122302281dbcd288a07072b /src/shared/varlink-io.systemd.service.c
parentvarlink: define interface io.systemd.service (diff)
downloadsystemd-ca46756cd80d34fac3f8ce9b3b126e537b09112f.tar.xz
systemd-ca46756cd80d34fac3f8ce9b3b126e537b09112f.zip
varlink: add generic impl. of io.systemd.varlink.Ping()
Diffstat (limited to 'src/shared/varlink-io.systemd.service.c')
-rw-r--r--src/shared/varlink-io.systemd.service.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/shared/varlink-io.systemd.service.c b/src/shared/varlink-io.systemd.service.c
index 5831581445..4b3240da7c 100644
--- a/src/shared/varlink-io.systemd.service.c
+++ b/src/shared/varlink-io.systemd.service.c
@@ -16,3 +16,14 @@ VARLINK_DEFINE_INTERFACE(
&vl_method_Ping,
&vl_method_Reload,
&vl_method_SetLogLevel);
+
+int varlink_method_ping(Varlink *link, JsonVariant *parameters, VarlinkMethodFlags flags, void *userdata) {
+ assert(link);
+
+ if (json_variant_elements(parameters) > 0)
+ return varlink_error_invalid_parameter(link, parameters);
+
+ log_debug("Received io.systemd.service.Ping");
+
+ return varlink_reply(link, NULL);
+}