summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-internal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd-bus/bus-internal.c')
-rw-r--r--src/libsystemd-bus/bus-internal.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libsystemd-bus/bus-internal.c b/src/libsystemd-bus/bus-internal.c
index 3271354600..0e66f3d355 100644
--- a/src/libsystemd-bus/bus-internal.c
+++ b/src/libsystemd-bus/bus-internal.c
@@ -241,3 +241,16 @@ int bus_message_type_from_string(const char *s, uint8_t *u) {
return 0;
}
+
+const char *bus_message_type_to_string(uint8_t u) {
+ if (u == SD_BUS_MESSAGE_TYPE_SIGNAL)
+ return "signal";
+ else if (u == SD_BUS_MESSAGE_TYPE_METHOD_CALL)
+ return "method_call";
+ else if (u == SD_BUS_MESSAGE_TYPE_METHOD_ERROR)
+ return "error";
+ else if (u == SD_BUS_MESSAGE_TYPE_METHOD_RETURN)
+ return "method_return";
+ else
+ return NULL;
+}