Tizen 2.1 base
[platform/core/connectivity/net-config.git] / include / netdbus.h
1 /*
2  * Network Configuration Module
3  *
4  * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 #ifndef __NETCONFIG_NETDBUS_H__
21 #define __NETCONFIG_NETDBUS_H__
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 #include <glib.h>
28 #include <dbus/dbus.h>
29 #include <dbus/dbus-glib.h>
30
31 #define CONNMAN_SERVICE                                 "net.connman"
32 #define CONNMAN_PATH                                    "/net/connman"
33
34 #define CONNMAN_CLOCK_INTERFACE                         CONNMAN_SERVICE ".Clock"
35 #define CONNMAN_MANAGER_INTERFACE                       CONNMAN_SERVICE ".Manager"
36 #define CONNMAN_SERVICE_INTERFACE                       CONNMAN_SERVICE ".Service"
37 #define CONNMAN_TECHNOLOGY_INTERFACE                    CONNMAN_SERVICE ".Technology"
38 #define CONNMAN_MANAGER_PATH                            "/"
39
40 #define CONNMAN_CELLULAR_SERVICE_PROFILE_PREFIX         CONNMAN_PATH "/service/cellular_"
41 #define CONNMAN_WIFI_SERVICE_PROFILE_PREFIX             CONNMAN_PATH "/service/wifi_"
42 #define CONNMAN_ETHERNET_SERVICE_PROFILE_PREFIX         CONNMAN_PATH "/service/ethernet_"
43 #define CONNMAN_BLUETOOTH_SERVICE_PROFILE_PREFIX        CONNMAN_PATH "/service/bluetooth_"
44 #define CONNMAN_WIFI_TECHNOLOGY_PREFIX                  CONNMAN_PATH "/technology/wifi"
45
46 #define NETCONFIG_WIFI_INTERFACE                        "net.netconfig.wifi"
47 #define NETCONFIG_WIFI_PATH                             "/net/netconfig/wifi"
48
49 #define DBUS_PATH_MAX_BUFLEN            512
50 #define DBUS_STATE_MAX_BUFLEN           64
51
52 typedef enum {
53         NETCONFIG_DBUS_RESULT_GET_BGSCAN_MODE,
54         NETCONFIG_DBUS_RESULT_DEFAULT_TECHNOLOGY,
55 } netconfig_dbus_result_type;
56
57 gboolean netconfig_is_cellular_profile(const char *profile);
58 gboolean netconfig_is_wifi_profile(const char *profile);
59 gboolean netconfig_is_ethernet_profile(const char *profile);
60 gboolean netconfig_is_bluetooth_profile(const char *profile);
61
62 char *netconfig_wifi_get_connected_service_name(DBusMessage *message);
63 DBusMessage *netconfig_invoke_dbus_method(const char *dest, const char *path,
64                 const char *interface_name, const char *method, char *param_array[]);
65 gboolean netconfig_dbus_get_basic_params_string(DBusMessage *message,
66                 char **key, void **value);
67 gboolean netconfig_dbus_get_basic_params_array(DBusMessage *message,
68                 char **key, void **value);
69
70 DBusGConnection *netconfig_setup_dbus(void);
71
72 #ifdef __cplusplus
73 }
74 #endif
75
76 #endif /* __NETCONFIG_NETDBUS_H__ */