On 21.07.2017 14:35, Lennart Poettering wrote: > On Wed, 19.07.17 11:20, Tilman Baumann ([email protected]) wrote: > >> My guess is that I can have it easier if I somehow use >> sd_bus_message_append() to assemble the message. But I don't see a clear >> path either. > > You have to do something like this: > > sd_bus_message_new_method(..., &m); > sd_bus_message_append(m, "i", ifindex); > sd_bus_message_open_container(m, 'a', '(iay)'); > for (i = 0; i < n_addresses; i++) { > sd_bus_message_open_container(m, '(', "iay")); > sd_bus_message_append(m, "i", addresses[i].sin_family); > sd_bus_message_append_array(m, 'y', &addresses[i].ip_addr, > sizeof(addresses[i].ip_addr)); > sd_bus_message_close_container(m); > } > sd_bus_message_close_container(m); > sd_bus_message_send(..., m); > sd_bus_message_unref(m); > > (not tested, just written down from the top of my head, and of course, > don't forget to add proper error checking)
Phantastic, thanks Lennart _______________________________________________ systemd-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/systemd-devel
