client: Add support for tethering
[platform/upstream/connman.git] / client / dbus_helpers.h
1 /*
2  *
3  *  Connection Manager
4  *
5  *  Copyright (C) 2013  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 #ifndef __CONNMANCTL_DBUS_HELPERS_H
24 #define __CONNMANCTL_DBUS_HELPERS_H
25
26 #include <dbus/dbus.h>
27 #include "../include/dbus.h"
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 void __connmanctl_dbus_print(DBusMessageIter *iter, const char *pre,
34                 const char *dict, const char *sep);
35
36 typedef void (*connmanctl_dbus_method_return_func_t)(DBusMessageIter *iter,
37                 const char *error, void *user_data);
38 int __connmanctl_dbus_method_call(DBusConnection *connection, const char *path,
39                 const char *interface, const char *method,
40                 connmanctl_dbus_method_return_func_t cb, void * user_data,
41                 int arg1, ...);
42
43 int __connmanctl_dbus_set_property(DBusConnection *connection,
44                 const char *path, const char *interface,
45                 connmanctl_dbus_method_return_func_t cb, void * user_data,
46                 const char *property, int type, void *value);
47
48 void __connmanctl_dbus_append_dict_entry(DBusMessageIter *iter, char *property,
49                 int type, void *value);
50 int __connmanctl_dbus_set_property_dict(DBusConnection *connection,
51                 const char *path, const char *interface,
52                 connmanctl_dbus_method_return_func_t cb, void * user_data,
53                 const char *property, int type,
54                 connman_dbus_append_cb_t append_fn, void *append_user_data);
55
56 void __connmanctl_dbus_append_dict_string_array(DBusMessageIter *iter,
57                 const char *property, connman_dbus_append_cb_t append_fn,
58                 void *append_user_data);
59 int __connmanctl_dbus_set_property_array(DBusConnection *connection,
60                 const char *path, const char *interface,
61                 connmanctl_dbus_method_return_func_t cb, void *user_data,
62                 const char *property, int type,
63                 connman_dbus_append_cb_t append_fn, void *append_user_data);
64
65 #ifdef __cplusplus
66 }
67 #endif
68
69 #endif