Merge "Check already powered during Wi-Fi enable/disable" into tizen
[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_ERROR_INTERFACE                         CONNMAN_SERVICE ".Error"
36 #define CONNMAN_MANAGER_INTERFACE                       CONNMAN_SERVICE ".Manager"
37 #define CONNMAN_SERVICE_INTERFACE                       CONNMAN_SERVICE ".Service"
38 #define CONNMAN_TECHNOLOGY_INTERFACE                    CONNMAN_SERVICE ".Technology"
39 #define CONNMAN_MANAGER_PATH                            "/"
40
41 #define CONNMAN_CELLULAR_SERVICE_PROFILE_PREFIX         CONNMAN_PATH "/service/cellular_"
42 #define CONNMAN_WIFI_SERVICE_PROFILE_PREFIX             CONNMAN_PATH "/service/wifi_"
43 #define CONNMAN_ETHERNET_SERVICE_PROFILE_PREFIX         CONNMAN_PATH "/service/ethernet_"
44 #define CONNMAN_BLUETOOTH_SERVICE_PROFILE_PREFIX        CONNMAN_PATH "/service/bluetooth_"
45 #define CONNMAN_CELLULAR_TECHNOLOGY_PREFIX              CONNMAN_PATH "/technology/cellular"
46 #define CONNMAN_WIFI_TECHNOLOGY_PREFIX                  CONNMAN_PATH "/technology/wifi"
47
48 #define NETCONFIG_WIFI_INTERFACE                        "net.netconfig.wifi"
49 #define NETCONFIG_WIFI_PATH                             "/net/netconfig/wifi"
50
51 #define DBUS_PATH_MAX_BUFLEN            512
52 #define DBUS_STATE_MAX_BUFLEN           64
53
54 typedef enum {
55         NETCONFIG_DBUS_RESULT_GET_BGSCAN_MODE,
56         NETCONFIG_DBUS_RESULT_DEFAULT_TECHNOLOGY,
57 } netconfig_dbus_result_type;
58
59 gboolean netconfig_is_cellular_profile(const char *profile);
60 gboolean netconfig_is_wifi_profile(const char *profile);
61 gboolean netconfig_is_ethernet_profile(const char *profile);
62 gboolean netconfig_is_bluetooth_profile(const char *profile);
63
64 char *netconfig_wifi_get_connected_service_name(DBusMessage *message);
65
66 gboolean netconfig_invoke_dbus_method_nonblock(
67                 const char *dest, const char *path,
68                 const char *interface_name, const char *method, char *param_array[],
69                 DBusPendingCallNotifyFunction notify_func);
70 DBusMessage *netconfig_invoke_dbus_method(const char *dest, const char *path,
71                 const char *interface_name, const char *method, char *param_array[]);
72
73 gboolean netconfig_dbus_get_basic_params_string(DBusMessage *message,
74                 char **key, int type, void *value);
75 gboolean netconfig_dbus_get_basic_params_array(DBusMessage *message,
76                 char **key, void **value);
77
78 DBusGConnection *netconfig_setup_dbus(void);
79
80 #ifdef __cplusplus
81 }
82 #endif
83
84 #endif /* __NETCONFIG_NETDBUS_H__ */