tizen 2.4 release
[framework/connectivity/mobileap-agent.git] / include / mobileap_wifi.h
1 /*
2  * mobileap-agent
3  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Apache License, Version 2.0 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 #ifndef __MOBILEAP_WIFI_H__
19 #define __MOBILEAP_WIFI_H__
20
21 #include "mobileap_softap.h"
22
23 #define VCONFKEY_MOBILE_HOTSPOT_SSID            "memory/private/mobileap-agent/ssid"
24 #define SOFTAP_SECURITY_TYPE_OPEN_STR           "open"
25 #define SOFTAP_SECURITY_TYPE_WPA2_PSK_STR       "wpa2-psk"
26 #define SOFTAP_PASSPHRASE_PATH                  "wifi_tethering.txt"
27 #define SOFTAP_PASSPHRASE_GROUP_ID              "secure-storage::tethering"
28
29 typedef enum {
30         SOFTAP_SECURITY_TYPE_OPEN,
31         SOFTAP_SECURITY_TYPE_WPA2_PSK,
32 } softap_security_type_e;
33
34 typedef struct {
35         int hide_mode;
36         char *ssid;
37         char *key;
38         softap_security_type_e security_type;
39 } wifi_saved_settings;
40
41 int _get_wifi_name_from_lease_info(const char *mac, char **name_buf);
42 mobile_ap_error_code_e _enable_wifi_tethering(Tethering *obj, gchar *ssid,
43         gchar *passphrase, int hide_mode, softap_security_type_e security_type);
44 mobile_ap_error_code_e _disable_wifi_tethering(Tethering *obj);
45 gboolean _is_trying_wifi_operation(void);
46 mobile_ap_error_code_e _reload_softap_settings(Tethering *obj,
47                 gchar *ssid, gchar *key, gint hide_mode, gint security_type);
48 mobile_ap_error_code_e _reload_softap_settings_for_ap(Tethering *obj,
49         gchar *ssid, gchar *key, gint hide_mode, gint security_type);
50
51 /* Dbus method */
52 mobile_ap_error_code_e _enable_wifi_ap(Tethering *obj, gchar *ssid,
53                 gchar *passphrase, int hide_mode,
54                 softap_security_type_e security_type);
55 mobile_ap_error_code_e _disable_wifi_ap(Tethering *obj);
56 gboolean tethering_enable_wifi_tethering(Tethering *obj,
57                 GDBusMethodInvocation *context, gchar *ssid,
58                 gchar *key, gint visibility, gint security_type);
59
60 softap_settings_t  *_get_softap_settings();
61
62 gboolean tethering_disable_wifi_tethering(Tethering *obj,
63                 GDBusMethodInvocation *context);
64
65 gboolean tethering_reload_wifi_settings(Tethering *obj,
66                 GDBusMethodInvocation *context,
67                 gchar *ssid, gchar *key, gint visibility, gint security_type);
68
69 gboolean tethering_reload_wifi_ap_settings(Tethering *obj,
70                                 GDBusMethodInvocation *context, gchar *ssid, gchar *key,
71                                 gint hide_mode, gint security);
72
73 gboolean tethering_enable_wifi_ap(Tethering *obj, GDBusMethodInvocation *context,
74                 gchar *ssid, gchar *key, gint hide_mode, gint security_type);
75
76 gboolean tethering_disable_wifi_ap(Tethering *obj,
77                 GDBusMethodInvocation *context);
78 #endif /* __MOBILEAP_WIFI_H__ */