DA: Applying secure log
[platform/core/connectivity/net-config.git] / include / wifi-netlink-scan.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_WIFI_NETLINK_SCAN_H__
21 #define __NETCONFIG_WIFI_NETLINK_SCAN_H__
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 #include "wifi.h"
28
29 #define NETCONFIG_SSID_LEN                      32
30 #define NETCONFIG_BSSID_LEN                     17
31 #define NETCONFIG_MAX_VSIE_LEN                  255
32 #define NETCONFIG_VENDOR_SPECIFIC_ID            221
33
34 #define NL80211_CMD_SCAN_ABORTED                35
35 #define NL80211_CMD_GET_SCAN                    32
36 #define NL80211_CMD_TRIGGER_SCAN                33
37 #define NL80211_CMD_NEW_SCAN_RESULTS            34
38 #define NL80211_BSS_BSSID                       1
39 #define NL80211_BSS_FREQUENCY                   2
40 #define NL80211_BSS_CAPABILITY                  5
41 #define NL80211_BSS_INFORMATION_ELEMENTS        6
42 #define NL80211_BSS_SIGNAL_MBM                  7
43 #define NL80211_BSS_MAX                         15
44 #define NL80211_ATTR_BSS                        47
45 #define NL80211_ATTR_IFINDEX                    3
46 #define NL80211_ATTR_IE                         42
47 #define NL80211_ATTR_SCAN_SSIDS                 45
48 #define NL80211_ATTR_MAX                        221
49
50 #define WLAN_CAPABILITY_PRIVACY                 (1<<4)
51
52 struct bss_scan_info_t {
53         char bssid[NETCONFIG_BSSID_LEN+1];
54         char ssid[NETCONFIG_SSID_LEN+1];
55         GSList* vsie_list;
56         int ssid_len;
57         int freq;
58         int signal;
59         int security_type;
60         int encryption_type;
61         int pmf_required;
62 };
63
64 struct netconfig_netlink_scan_results {
65     int done;
66     int aborted;
67 };
68
69 struct netconfig_netlink_scan_handler_args {
70     const char *group;
71     int id;
72 };
73
74 typedef struct {
75         int id;
76         int if_index;
77         struct nl_sock *socket;
78         struct nl_msg *msg;
79 } netconfig_nl_global;
80
81 void __netconfig_notify_netlink_scan_done(const char *interface_name);
82 int handle_netlink_scan(Wifi *wifi, GDBusMethodInvocation *context,
83                 const gchar *ifname, GVariant *params);
84
85 #ifdef __cplusplus
86 }
87 #endif
88
89 #endif /* __NETCONFIG_WIFI_NETLINK_SCAN_H__ */