bus-message.h revision 392d5b378ceae5e1fd7c91ca545fcf4cd105744a
d657c51f14601d0235434ffb78cf6ac0f27cc83cLennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
194bbe33382f5365be3865ed1779147cb680f1d3Kay Sievers This file is part of systemd.
194bbe33382f5365be3865ed1779147cb680f1d3Kay Sievers Copyright 2013 Lennart Poettering
07cd4fc16806783d3b6b3008db222ac6a024805cKay Sievers systemd is free software; you can redistribute it and/or modify it
91cf7e5c37f97c6eb29966fac0afcbaa6662e05dTollef Fog Heen under the terms of the GNU Lesser General Public License as published by
f13b388f97bc3ba8db844bd3413d510e2466a0b6Kay Sievers the Free Software Foundation; either version 2.1 of the License, or
f13b388f97bc3ba8db844bd3413d510e2466a0b6Kay Sievers (at your option) any later version.
2d13da8821b8197e62f819b5b996750800e910abKay Sievers systemd is distributed in the hope that it will be useful, but
2d13da8821b8197e62f819b5b996750800e910abKay Sievers WITHOUT ANY WARRANTY; without even the implied warranty of
2d13da8821b8197e62f819b5b996750800e910abKay Sievers MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2d13da8821b8197e62f819b5b996750800e910abKay Sievers Lesser General Public License for more details.
194bbe33382f5365be3865ed1779147cb680f1d3Kay Sievers You should have received a copy of the GNU Lesser General Public License
194bbe33382f5365be3865ed1779147cb680f1d3Kay Sievers along with systemd; If not, see <http://www.gnu.org/licenses/>.
ea5943d3862cc690daa76e2ad336737407ec711cLennart Poettering struct bus_container root_container, *containers;
ea5943d3862cc690daa76e2ad336737407ec711cLennart Poettering#define BUS_MESSAGE_NEED_BSWAP(m) ((m)->header->endian != SD_BUS_NATIVE_ENDIAN)
ea5943d3862cc690daa76e2ad336737407ec711cLennart Poetteringstatic inline uint16_t BUS_MESSAGE_BSWAP16(sd_bus_message *m, uint16_t u) {
ea5943d3862cc690daa76e2ad336737407ec711cLennart Poettering return BUS_MESSAGE_NEED_BSWAP(m) ? bswap_16(u) : u;
ea5943d3862cc690daa76e2ad336737407ec711cLennart Poetteringstatic inline uint32_t BUS_MESSAGE_BSWAP32(sd_bus_message *m, uint32_t u) {
ea5943d3862cc690daa76e2ad336737407ec711cLennart Poettering return BUS_MESSAGE_NEED_BSWAP(m) ? bswap_32(u) : u;
ea5943d3862cc690daa76e2ad336737407ec711cLennart Poetteringstatic inline uint64_t BUS_MESSAGE_BSWAP64(sd_bus_message *m, uint64_t u) {
ea5943d3862cc690daa76e2ad336737407ec711cLennart Poettering return BUS_MESSAGE_NEED_BSWAP(m) ? bswap_64(u) : u;
ea5943d3862cc690daa76e2ad336737407ec711cLennart Poetteringstatic inline uint32_t BUS_MESSAGE_SERIAL(sd_bus_message *m) {
ea5943d3862cc690daa76e2ad336737407ec711cLennart Poettering return BUS_MESSAGE_BSWAP32(m, m->header->serial);
ea5943d3862cc690daa76e2ad336737407ec711cLennart Poetteringstatic inline uint32_t BUS_MESSAGE_BODY_SIZE(sd_bus_message *m) {
ea5943d3862cc690daa76e2ad336737407ec711cLennart Poettering return BUS_MESSAGE_BSWAP32(m, m->header->body_size);
ea5943d3862cc690daa76e2ad336737407ec711cLennart Poetteringstatic inline uint32_t BUS_MESSAGE_FIELDS_SIZE(sd_bus_message *m) {
ea5943d3862cc690daa76e2ad336737407ec711cLennart Poettering return BUS_MESSAGE_BSWAP32(m, m->header->fields_size);
ea5943d3862cc690daa76e2ad336737407ec711cLennart Poetteringstatic inline void bus_message_unrefp(sd_bus_message **m) {
ea5943d3862cc690daa76e2ad336737407ec711cLennart Poettering#define _cleanup_bus_message_unref_ __attribute__((cleanup(bus_message_unrefp)))
ea5943d3862cc690daa76e2ad336737407ec711cLennart Poetteringint bus_message_seal(sd_bus_message *m, uint64_t serial);
ea5943d3862cc690daa76e2ad336737407ec711cLennart Poetteringint bus_message_get_blob(sd_bus_message *m, void **buffer, size_t *sz);
ea5943d3862cc690daa76e2ad336737407ec711cLennart Poetteringint bus_message_read_strv_extend(sd_bus_message *m, char ***l);
ea5943d3862cc690daa76e2ad336737407ec711cLennart Poetteringconst char* bus_message_get_arg(sd_bus_message *m, unsigned i);