Merge "Optional autogen.sh flag --enable-kdbus-transport added allowing to compile...
[platform/upstream/dbus.git] / dbus / kdbus-common.h
1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 /* kdbus-common.h  kdbus related utils for daemon and libdbus
3  *
4  * Copyright (C) 2013  Samsung Electronics
5  *
6  * Licensed under the Academic Free License version 2.1
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version and under the terms of the GNU
12  * Lesser General Public License as published by the
13  * Free Software Foundation; either version 2.1 of the License, or (at
14  * your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
24  *
25  */
26
27 #ifndef KDBUS_COMMON_H_
28 #define KDBUS_COMMON_H_
29
30 #include <dbus/dbus-types.h>
31 #include <dbus/dbus-transport.h>
32
33 #define KDBUS_ALIGN8(l) (((l) + 7) & ~7)
34 #define KDBUS_PART_NEXT(part) \
35         (typeof(part))(((uint8_t *)part) + KDBUS_ALIGN8((part)->size))
36 #define KDBUS_ITEM_SIZE(s) KDBUS_ALIGN8((s) + KDBUS_PART_HEADER_SIZE)
37
38 /*struct kdbus_policy *make_policy_name(const char *name);
39 struct kdbus_policy *make_policy_access(__u64 type, __u64 bits, __u64 id);
40 void append_policy(struct kdbus_cmd_policy *cmd_policy, struct kdbus_policy *policy, __u64 max_size);*/
41 dbus_bool_t register_kdbus_policy(const char* name, int fd);
42 dbus_bool_t list_kdbus_names(int fd, char ***listp, int *array_len);
43 int request_kdbus_name(int fd, const char *name, const __u64 flags, __u64 id);
44 int release_kdbus_name(int fd, const char *name, __u64 id);
45
46 #endif /* KDBUS_COMMON_H_ */