Add multi interfaces function
[platform/core/connectivity/net-config.git] / include / netsupplicant.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_NETSUPPLICANT_H__
21 #define __NETCONFIG_NETSUPPLICANT_H__
22
23 #include "netdbus.h"
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 #define  WIFI_IFNAME                                    "wlan0"
30 /* Adhoc solution to use P2P interface */
31 #define  WIFI_P2P_IFNAME                                "p2p0"
32
33 #define SUPPLICANT_SERVICE                              "fi.w1.wpa_supplicant1"
34 #define SUPPLICANT_INTERFACE                    "fi.w1.wpa_supplicant1"
35 #define SUPPLICANT_IFACE_INTERFACE              SUPPLICANT_INTERFACE ".Interface"
36 #define SUPPLICANT_IFACE_BSS                    SUPPLICANT_INTERFACE ".BSS"
37 #define SUPPLICANT_IFACE_WPS                    SUPPLICANT_INTERFACE ".Interface.WPS"
38 #define SUPPLICANT_IFACE_DPP                    SUPPLICANT_INTERFACE ".Interface.DPP"
39 #define SUPPLICANT_PATH                                 "/fi/w1/wpa_supplicant1"
40
41 struct dbus_input_arguments {
42         int type;
43         void *data;
44 };
45
46 /* Returns Supplicant interface.
47  * Need to release interface using g_free */
48 char *netconfig_get_supplicant_interface(const char *ifname);
49
50 /* Returns Supplicant interface.
51  * Need to release interface using g_free */
52 char *netconfig_wifi_get_supplicant_interface_path(const char *interface_name);
53 /* Adhoc solution to use P2P interface */
54 char *netconfig_wifi_get_supplicant_p2p_interface(void);
55
56 GList *setup_input_args(GList *list, struct dbus_input_arguments *items);
57 GVariant *netconfig_supplicant_invoke_dbus_method(const char *dest, const char *path,
58                 const char *interface_name, const char *method,
59                 GVariant *params);
60 gboolean netconfig_supplicant_invoke_dbus_method_nonblock(const char *dest,
61                 const char *path, const char *interface_name,
62                 const char *method, GVariant *params,
63                 GAsyncReadyCallback notify_func, void *user_data);
64 GVariant *netconfig_supplicant_invoke_dbus_interface_property_get(const char *interface_name,
65                         const char *key);
66 gboolean netconfig_supplicant_invoke_dbus_interface_property_set(const char *interface_name,
67                         const char *key, GVariant *message,
68                         GAsyncReadyCallback notify_func);
69
70 #ifdef __cplusplus
71 }
72 #endif
73
74 #endif /* __NETCONFIG_NETSUPPLICANT_H__ */