summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd/libsystemd.sym1
-rw-r--r--src/libsystemd/sd-bus/bus-dump.c4
-rw-r--r--src/libsystemd/sd-bus/bus-kernel.c1
-rw-r--r--src/libsystemd/sd-bus/bus-message.c9
-rw-r--r--src/libsystemd/sd-bus/bus-message.h1
-rw-r--r--src/systemd/sd-bus.h2
6 files changed, 17 insertions, 1 deletions
diff --git a/src/libsystemd/libsystemd.sym b/src/libsystemd/libsystemd.sym
index cda10ea62a..723546ace2 100644
--- a/src/libsystemd/libsystemd.sym
+++ b/src/libsystemd/libsystemd.sym
@@ -94,6 +94,7 @@ global:
sd_bus_message_get_errno;
sd_bus_message_get_monotonic_timestamp;
sd_bus_message_get_realtime_timestamp;
+ sd_bus_message_get_seqnum;
sd_bus_message_get_creds;
sd_bus_message_is_signal;
sd_bus_message_is_method_call;
diff --git a/src/libsystemd/sd-bus/bus-dump.c b/src/libsystemd/sd-bus/bus-dump.c
index 78e7597ed5..d2c0684448 100644
--- a/src/libsystemd/sd-bus/bus-dump.c
+++ b/src/libsystemd/sd-bus/bus-dump.c
@@ -100,8 +100,10 @@ int bus_message_dump(sd_bus_message *m, FILE *f, bool with_header) {
fprintf(f, " Monotonic=%llu", (unsigned long long) m->monotonic);
if (m->realtime != 0)
fprintf(f, " Realtime=%llu", (unsigned long long) m->realtime);
+ if (m->seqnum != 0)
+ fprintf(f, " SequenceNumber=%llu", (unsigned long long) m->seqnum);
- if (m->monotonic != 0 || m->realtime != 0)
+ if (m->monotonic != 0 || m->realtime != 0 || m->seqnum != 0)
fputs("\n", f);
bus_creds_dump(&m->creds, f);
diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c
index 99ac5b1ed3..fdb4dab2da 100644
--- a/src/libsystemd/sd-bus/bus-kernel.c
+++ b/src/libsystemd/sd-bus/bus-kernel.c
@@ -501,6 +501,7 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) {
case KDBUS_ITEM_TIMESTAMP:
m->realtime = d->timestamp.realtime_ns / NSEC_PER_USEC;
m->monotonic = d->timestamp.monotonic_ns / NSEC_PER_USEC;
+ m->seqnum = d->timestamp.seqnum;
break;
case KDBUS_ITEM_PID_COMM:
diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c
index 1a2039b8cd..0c3913e2b0 100644
--- a/src/libsystemd/sd-bus/bus-message.c
+++ b/src/libsystemd/sd-bus/bus-message.c
@@ -898,6 +898,15 @@ _public_ int sd_bus_message_get_realtime_timestamp(sd_bus_message *m, uint64_t *
return 0;
}
+_public_ int sd_bus_message_get_seqnum(sd_bus_message *m, uint64_t *seqnum) {
+ assert_return(m, -EINVAL);
+ assert_return(seqnum, -EINVAL);
+ assert_return(m->seqnum > 0, -ENODATA);
+
+ *seqnum = m->seqnum;
+ return 0;
+}
+
_public_ sd_bus_creds *sd_bus_message_get_creds(sd_bus_message *m) {
assert_return(m, NULL);
diff --git a/src/libsystemd/sd-bus/bus-message.h b/src/libsystemd/sd-bus/bus-message.h
index 5322375ef1..0c90e726de 100644
--- a/src/libsystemd/sd-bus/bus-message.h
+++ b/src/libsystemd/sd-bus/bus-message.h
@@ -98,6 +98,7 @@ struct sd_bus_message {
usec_t monotonic;
usec_t realtime;
+ uint64_t seqnum;
bool sealed:1;
bool dont_send:1;
diff --git a/src/systemd/sd-bus.h b/src/systemd/sd-bus.h
index a6c29d4586..fc9a809e39 100644
--- a/src/systemd/sd-bus.h
+++ b/src/systemd/sd-bus.h
@@ -202,6 +202,8 @@ int sd_bus_message_get_errno(sd_bus_message *m);
int sd_bus_message_get_monotonic_timestamp(sd_bus_message *m, uint64_t *usec);
int sd_bus_message_get_realtime_timestamp(sd_bus_message *m, uint64_t *usec);
+int sd_bus_message_get_seqnum(sd_bus_message *m, uint64_t* seqnum);
+
sd_bus_creds *sd_bus_message_get_creds(sd_bus_message *m); /* do not unref the result */
int sd_bus_message_is_signal(sd_bus_message *m, const char *interface, const char *member);