client: Reduce technology logging
[platform/upstream/connman.git] / client / dbus.h
1 /*
2  *
3  *  Connection Manager
4  *
5  *  Copyright (C) 2012  Intel Corporation. All rights reserved.
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2 of the License, or
10  *  (at your option) any later version.
11  *
12  *  This program is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *  GNU General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with this program; if not, write to the Free Software
19  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20  *
21  */
22
23 #include <dbus/dbus.h>
24
25 #define CONNMAN_SERVICE                 "net.connman"
26
27 #define CONNMAN_MANAGER_INTERFACE       CONNMAN_SERVICE ".Manager"
28 #define CONNMAN_MANAGER_PATH            "/"
29
30 #define CONNMAN_SERVICE_INTERFACE       CONNMAN_SERVICE ".Service"
31
32 void dbus_property_append_basic(DBusMessageIter *iter,
33                                         const char *key, int type, void *val);
34
35 static inline void dbus_dict_open(DBusMessageIter *iter, DBusMessageIter *dict)
36 {
37         dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY,
38                         DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
39                         DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING
40                         DBUS_DICT_ENTRY_END_CHAR_AS_STRING, dict);
41 }
42
43 static inline void dbus_dict_open_variant(DBusMessageIter *iter,
44                                                         DBusMessageIter *dict)
45 {
46         dbus_message_iter_open_container(iter, DBUS_TYPE_VARIANT,
47                         DBUS_TYPE_ARRAY_AS_STRING
48                         DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
49                         DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING
50                         DBUS_DICT_ENTRY_END_CHAR_AS_STRING, dict);
51 }
52
53 static inline void dbus_array_open(DBusMessageIter *iter, DBusMessageIter *dict)
54 {
55         dbus_message_iter_open_container(iter, DBUS_TYPE_VARIANT,
56                         DBUS_TYPE_ARRAY_AS_STRING
57                         DBUS_TYPE_STRING_AS_STRING,
58                         dict);
59 }
60
61 static inline void dbus_dict_close(DBusMessageIter *iter, DBusMessageIter *dict)
62 {
63         dbus_message_iter_close_container(iter, dict);
64 }
65