Replace WPS scan to BSSID scan keywords.
[platform/core/connectivity/net-config.git] / include / netdbus.h
1 /*
2  * Network Configuration Module
3  *
4  * Copyright (c) 2000 - 2012 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 #include <glib.h>
24 #include <gio/gio.h>
25 #include <glib-object.h>
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 #define DBUS_REPLY_TIMEOUT              (120 * 1000)
32 #define NETCONFIG_DBUS_REPLY_TIMEOUT    (15 * 1000)
33 #define DBUS_INTERFACE_PROPERTIES       "org.freedesktop.DBus.Properties"
34
35 #define NETCONFIG_SERVICE                               "net.netconfig"
36
37 #define CONNMAN_SERVICE                                 "net.connman"
38 #define CONNMAN_PATH                                    "/net/connman"
39
40 #define CONNMAN_CLOCK_INTERFACE                 CONNMAN_SERVICE ".Clock"
41 #define CONNMAN_ERROR_INTERFACE                 CONNMAN_SERVICE ".Error"
42 #define CONNMAN_MANAGER_INTERFACE               CONNMAN_SERVICE ".Manager"
43 #define CONNMAN_SERVICE_INTERFACE               CONNMAN_SERVICE ".Service"
44 #define CONNMAN_TECHNOLOGY_INTERFACE    CONNMAN_SERVICE ".Technology"
45 #define CONNMAN_MANAGER_PATH                    "/"
46
47 #define CONNMAN_CELLULAR_SERVICE_PROFILE_PREFIX CONNMAN_PATH "/service/cellular_"
48 #define CONNMAN_WIFI_SERVICE_PROFILE_PREFIX             CONNMAN_PATH "/service/wifi_"
49 #define CONNMAN_ETHERNET_SERVICE_PROFILE_PREFIX CONNMAN_PATH "/service/ethernet_"
50 #define CONNMAN_BLUETOOTH_SERVICE_PROFILE_PREFIX \
51                                                                                         CONNMAN_PATH "/service/bluetooth_"
52
53 #define CONNMAN_CELLULAR_TECHNOLOGY_PREFIX      CONNMAN_PATH "/technology/cellular"
54 #define CONNMAN_WIFI_TECHNOLOGY_PREFIX          CONNMAN_PATH "/technology/wifi"
55 #define CONNMAN_ETHERNET_TECHNOLOGY_PREFIX      CONNMAN_PATH "/technology/ethernet"
56 #define CONNMAN_BLUETOOTH_TECHNOLOGY_PREFIX     CONNMAN_PATH "/technology/bluetooth"
57
58 #define NETCONFIG_WIFI_INTERFACE                "net.netconfig.wifi"
59 #define NETCONFIG_WIFI_PATH                     "/net/netconfig/wifi"
60 #define NETCONFIG_NETWORK_STATE_PATH            "/net/netconfig/network"
61 #define NETCONFIG_NETWORK_STATISTICS_PATH       "/net/netconfig/network_statistics"
62 #define NETCONFIG_NETWORK_PATH                  "/net/netconfig/network"
63 #define NETCONFIG_NETWORK_INTERFACE             "net.netconfig.network"
64 #define NETCONFIG_VPNSVC_PATH           "/net/netconfig/vpnsvc"
65 #define NETCONFIG_VPNSVC_INTERFACE      "net.netconfig.vpnsvc"
66
67 #define DBUS_PATH_MAX_BUFLEN            512
68 #define DBUS_STATE_MAX_BUFLEN           64
69
70 typedef enum {
71         NETCONFIG_DBUS_RESULT_GET_BGSCAN_MODE,
72         NETCONFIG_DBUS_RESULT_DEFAULT_TECHNOLOGY,
73 } netconfig_dbus_result_type;
74
75 typedef void (*got_name_cb)(void);
76
77 GDBusObjectManagerServer        *netdbus_get_wifi_manager(void);
78 GDBusObjectManagerServer        *netdbus_get_state_manager(void);
79 GDBusObjectManagerServer        *netdbus_get_statistics_manager(void);
80 GDBusObjectManagerServer        *netdbus_get_vpn_manager(void);
81
82 GDBusConnection                         *netdbus_get_connection(void);
83 GCancellable                            *netdbus_get_cancellable(void);
84 void netconfig_gdbus_pending_call_ref(void);
85 void netconfig_gdbus_pending_call_unref(void);
86 int netconfig_create_gdbus_call(GDBusConnection *conn);
87
88 gboolean netconfig_is_cellular_internet_profile(const char *profile);
89 gboolean netconfig_is_cellular_profile(const char *profile);
90 gboolean netconfig_is_wifi_profile(const char *profile);
91 gboolean netconfig_is_ethernet_profile(const char *profile);
92 gboolean netconfig_is_bluetooth_profile(const char *profile);
93
94 gboolean netconfig_invoke_dbus_method_nonblock(const char *dest, const char *path,
95                 const char *interface_name, const char *method, GVariant *params,
96                 GAsyncReadyCallback notify_func);
97 GVariant *netconfig_invoke_dbus_method(const char *dest, const char *path,
98                 const char *interface_name, const char *method,
99                 GVariant *params);
100 gboolean netconfig_dbus_emit_signal(const gchar *destination_bus_name,
101                 const gchar *object_path,
102                 const gchar *interface_name,
103                 const gchar *signal_name,
104                 GVariant *params);
105
106 int             setup_gdbus(got_name_cb cb);
107 void    cleanup_gdbus(void);
108
109 #ifdef __cplusplus
110 }
111 #endif
112
113 #endif /* __NETCONFIG_NETDBUS_H__ */