[Support Legacy Connection] Update peer disconnection logic.
[platform/core/connectivity/wifi-direct-manager.git] / plugin / wpasupplicant / emul / include / wfd-plugin-wpasupplicant.h
1 /*
2  * Network Configuration Module
3  *
4  * Copyright (c) 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 /**
21  * This file declares wifi direct wpasupplicant plugin functions and structures.
22  *
23  * @file                wfd-plugin-wpasupplicant.h
24  * @author      Gibyoung Kim (lastkgb.kim@samsung.com)
25  * @version     0.7
26  */
27
28 #ifndef __WFD_PLUGIN_WPASUPPLICANT_H__
29 #define __WFD_PLUGIN_WPASUPPLICANT_H__
30
31 #ifdef USE_DLOG
32 #include <dlog.h>
33
34 #undef LOG_TAG
35 #define LOG_TAG "WIFI_DIRECT_PLUGIN"
36
37 #define WDP_LOGV(format, args...) LOGV(format, ##args)
38 #define WDP_LOGD(format, args...) LOGD(format, ##args)
39 #define WDP_LOGI(format, args...) LOGI(format, ##args)
40 #define WDP_LOGW(format, args...) LOGW(format, ##args)
41 #define WDP_LOGE(format, args...) LOGE(format, ##args)
42 #define WDP_LOGF(format, args...) LOGF(format, ##args)
43
44 #define __WDP_LOG_FUNC_ENTER__ LOGD("Enter")
45 #define __WDP_LOG_FUNC_EXIT__ LOGD("Quit")
46
47 #define WDP_SECLOGI(format, args...) SECURE_LOG(LOG_INFO, LOG_TAG, format, ##args)
48 #define WDP_SECLOGD(format, args...) SECURE_LOG(LOG_DEBUG, LOG_TAG, format, ##args)
49
50 #else /* USE_DLOG */
51
52 #define WDP_LOGV(format, args...)
53 #define WDP_LOGD(format, args...)
54 #define WDP_LOGI(format, args...)
55 #define WDP_LOGW(format, args...)
56 #define WDP_LOGE(format, args...)
57 #define WDP_LOGF(format, args...)
58
59 #define __WDP_LOG_FUNC_ENTER__
60 #define __WDP_LOG_FUNC_EXIT__
61
62 #define WDP_SECLOGI(format, args...)
63 #define WDP_SECLOGD(format, args...)
64
65 #endif /* USE_DLOG */
66
67 int ws_init(wfd_oem_event_cb callback, void *user_data);
68 int ws_deinit();
69 int ws_activate(int concurrent);
70 int ws_deactivate(int concurrent);
71 int ws_start_scan(wfd_oem_scan_param_s *param);
72 int ws_restart_scan(int freq);
73 int ws_stop_scan();
74 int ws_get_visibility(int *visibility);
75 int ws_set_visibility(int visibility);
76 int ws_get_scan_result(GList **peers, int *peer_count);
77 int ws_get_peer_info(unsigned char *peer_addr, wfd_oem_device_s **peer);
78 int ws_prov_disc_req(unsigned char *peer_addr, wfd_oem_wps_mode_e wps_mode, int join);
79 int ws_connect(unsigned char *peer_addr, wfd_oem_conn_param_s *param);
80 int ws_disconnect(unsigned char *peer_addr, int is_iface_addr);
81 int ws_reject_connection(unsigned char *peer_addr);
82 int ws_cancel_connection(unsigned char *peer_addr);
83 int ws_get_connected_peers(GList **peers, int *peer_count);
84 int ws_get_pin(char *pin);
85 int ws_set_pin(char *pin);
86 int ws_generate_pin(char **pin);
87 int ws_get_supported_wps_mode();
88 int ws_create_group(wfd_oem_group_param_s *param);
89 int ws_destroy_group(const char *ifname);
90 int ws_invite(unsigned char *peer_addr, wfd_oem_invite_param_s *param);
91 int ws_wps_start(unsigned char *peer_addr, int wps_mode, const char *pin);
92 int ws_enrollee_start(unsigned char *peer_addr, int wps_mode, const char *pin);
93 int ws_wps_cancel();
94 int ws_get_dev_name(char *dev_name);
95 int ws_set_dev_name(char *dev_name);
96 int ws_get_dev_mac(char *dev_mac);
97 int ws_get_dev_type(int *pri_dev_type, int *sec_dev_type);
98 int ws_set_dev_type(int pri_dev_type, int sec_dev_type);
99 int ws_get_go_intent(int *go_intent);
100 int ws_set_go_intent(int go_intent);
101 int ws_set_country(char *ccode);
102
103 int ws_get_persistent_groups(wfd_oem_persistent_group_s **groups, int *group_count);
104 int ws_remove_persistent_group(char *ssid, unsigned char *bssid);
105 int ws_set_persistent_reconnect(unsigned char *bssid, int reconnect);
106
107 #ifdef TIZEN_FEATURE_SERVICE_DISCOVERY
108 int ws_start_service_discovery(unsigned char *mac_addr, int service_type);
109 int ws_cancel_service_discovery(unsigned char *mac_addr, int service_type);
110
111 int ws_serv_add(wfd_oem_new_service_s *service);
112 int ws_serv_del(wfd_oem_new_service_s *service);
113 #endif /* TIZEN_FEATURE_SERVICE_DISCOVERY */
114
115 #ifdef TIZEN_FEATURE_WIFI_DISPLAY
116 int ws_miracast_init(int enable);
117 int ws_set_display(wfd_oem_display_s *wifi_display);
118 #endif /* TIZEN_FEATURE_WIFI_DISPLAY */
119
120 int ws_refresh();
121 int ws_save_config(void);
122 int ws_set_operating_channel(int channel);
123 int ws_remove_all_network(void);
124 int ws_get_wpa_status(int *wpa_status);
125
126 #if defined(TIZEN_FEATURE_ASP)
127 int ws_advertise_service(wfd_oem_asp_service_s *service, int replace);
128 int ws_cancel_advertise_service(wfd_oem_asp_service_s *service);
129 int ws_seek_service(wfd_oem_asp_service_s *service);
130 int ws_cancel_seek_service(wfd_oem_asp_service_s *service);
131 int ws_asp_prov_disc_req(wfd_oem_asp_prov_s *asp_params);
132 #endif /* TIZEN_FEATURE_ASP */
133 #endif /* __WFD_PLUGIN_WPASUPPLICANT_H__ */