bus-message.h revision de1c301ed165eb4d04a0c9d4babe97912b5233bb
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#pragma once
/***
This file is part of systemd.
Copyright 2013 Lennart Poettering
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <stdbool.h>
#include <byteswap.h>
#include "macro.h"
#include "sd-bus.h"
struct bus_container {
char enclosing;
char *signature;
unsigned index;
};
_packed_ struct bus_header {
};
struct sd_bus_message {
unsigned n_ref;
const char *path;
const char *interface;
const char *member;
const char *destination;
const char *sender;
const char *signature;
bool sealed:1;
bool uid_valid:1;
bool gid_valid:1;
bool free_header:1;
bool free_fields:1;
bool free_body:1;
struct bus_header *header;
void *fields;
void *body;
int *fds;
unsigned n_containers;
unsigned n_iovec;
};
#if __BYTE_ORDER == __BIG_ENDIAN
#else
#endif
return BUS_MESSAGE_NEED_BSWAP(m) ? bswap_32(u) : u;
}
}
}
}
static inline void bus_message_unrefp(sd_bus_message **m) {
sd_bus_message_unref(*m);
}
int message_parse(sd_bus_message *m);
void message_dump(sd_bus_message *m);