]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
varlink: define interface io.systemd.service
authorDavid Tardon <dtardon@redhat.com>
Mon, 30 Oct 2023 09:35:45 +0000 (10:35 +0100)
committerDavid Tardon <dtardon@redhat.com>
Tue, 31 Oct 2023 11:49:16 +0000 (12:49 +0100)
src/shared/meson.build
src/shared/varlink-io.systemd.service.c [new file with mode: 0644]
src/shared/varlink-io.systemd.service.h [new file with mode: 0644]
src/test/test-varlink-idl.c

index 5b20155b24009d1370671a5341fc5811cbbbd5aa..0ef34d4bc864c84095e401042bff25e135e56680 100644 (file)
@@ -176,6 +176,7 @@ shared_sources = files(
         'varlink-io.systemd.Resolve.c',
         'varlink-io.systemd.UserDatabase.c',
         'varlink-io.systemd.oom.c',
+        'varlink-io.systemd.service.c',
         'varlink-io.systemd.sysext.c',
         'varlink-org.varlink.service.c',
         'verb-log-control.c',
diff --git a/src/shared/varlink-io.systemd.service.c b/src/shared/varlink-io.systemd.service.c
new file mode 100644 (file)
index 0000000..5831581
--- /dev/null
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include "varlink-io.systemd.service.h"
+
+static VARLINK_DEFINE_METHOD(Ping);
+
+static VARLINK_DEFINE_METHOD(Reload);
+
+static VARLINK_DEFINE_METHOD(
+                SetLogLevel,
+                VARLINK_DEFINE_INPUT(level, VARLINK_INT, 0));
+
+VARLINK_DEFINE_INTERFACE(
+                io_systemd_service,
+                "io.systemd.service",
+                &vl_method_Ping,
+                &vl_method_Reload,
+                &vl_method_SetLogLevel);
diff --git a/src/shared/varlink-io.systemd.service.h b/src/shared/varlink-io.systemd.service.h
new file mode 100644 (file)
index 0000000..1f599d2
--- /dev/null
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#pragma once
+
+#include "varlink-idl.h"
+
+extern const VarlinkInterface vl_interface_io_systemd_service;
index 670fc0515d7175ff88bc07d370417319c46c4619..167e8eaff686d1850fc2d706ee30a75602f78c16 100644 (file)
@@ -15,6 +15,7 @@
 #include "varlink-io.systemd.Resolve.h"
 #include "varlink-io.systemd.UserDatabase.h"
 #include "varlink-io.systemd.oom.h"
+#include "varlink-io.systemd.service.h"
 #include "varlink-io.systemd.sysext.h"
 #include "varlink-org.varlink.service.h"
 
@@ -138,6 +139,8 @@ TEST(parse_format) {
         print_separator();
         test_parse_format_one(&vl_interface_io_systemd_PCRExtend);
         print_separator();
+        test_parse_format_one(&vl_interface_io_systemd_service);
+        print_separator();
         test_parse_format_one(&vl_interface_io_systemd_sysext);
         print_separator();
         test_parse_format_one(&vl_interface_xyz_test);