[TSAM-1605] Fixed the issue Confusing error code is returned if wifi is already initi...
[platform/core/api/wifi.git] / include / wifi_config_private.h
1 #ifndef __WIFI_CONFIG_H__
2 #define __WIFI_CONFIG_H__
3
4 #include <glib.h>
5
6 #include "wifi.h"
7 #include "wifi_dbus_private.h"
8
9 #define WIFI_CONFIG_NAME                        "Name"
10 #define WIFI_CONFIG_SSID                "SSID"
11 #define WIFI_CONFIG_PASSPHRASE                  "Passphrase"
12 #define WIFI_CONFIG_SECURITY_TYPE       "Security"
13 #define WIFI_CONFIG_PROXYADDRESS                "ProxyAddress"
14 #define WIFI_CONFIG_HIDDEN                              "Hidden"
15 #define WIFI_CONFIG_FAILURE                     "Failure"
16 #define WIFI_CONFIG_EAP_ANONYMOUS_IDENTITY                      "AnonymousIdentity"
17 #define WIFI_CONFIG_EAP_CACERT                  "CACertFile"
18 #define WIFI_CONFIG_EAP_CLIENTCERT                      "ClientCertFile"
19 #define WIFI_CONFIG_EAP_PRIVATEKEY              "PrivateKeyFile"
20 #define WIFI_CONFIG_EAP_IDENTITY                "Identity"
21 #define WIFI_CONFIG_EAP_TYPE            "EapType"
22 #define WIFI_CONFIG_EAP_AUTH_TYPE       "EapAuthType"
23 #define WIFI_CONFIG_EAP_SUBJECT_MATCH   "SubjectMatch"
24
25 struct _wifi_eap_config {
26         gchar *ca_cert;
27         gchar *private_key;
28         gchar *client_cert;
29         gchar *anonymous_identity;
30         gchar *identity;
31         gchar *subject_match;
32         wifi_eap_type_e eap_type;
33         wifi_eap_auth_type_e eap_auth_type;
34 };
35
36 struct _wifi_config {
37         // mandatory
38         gchar *name;
39         gchar *passphrase;
40         wifi_security_type_e security_type;
41         gboolean is_saved;
42
43         // optional field is set using wifi_config_set_field
44         gboolean is_hidden;
45         gchar *proxy_address;
46         wifi_address_family_e address_family;
47         struct _wifi_eap_config *eap_config;
48         wifi_error_e last_error;
49 };
50
51 gchar * wifi_config_get_config_id(const gchar *name, wifi_security_type_e security_type);
52 GSList *wifi_config_get_config_id_list(wifi_dbus *handle);
53
54 int wifi_config_get_last_error(wifi_config_h config, wifi_error_e *last_error);
55
56 int wifi_save_configurations(wifi_dbus *handle, const gchar *name, const gchar *passphrase, wifi_security_type_e security_type, const gchar *proxy_address, gboolean is_hidden);
57 int wifi_load_configurations(wifi_dbus *handle, const gchar *config_id, gchar **name, wifi_security_type_e *security_type, gchar **proxy_address, gboolean *is_hidden, wifi_error_e *last_error);
58 int wifi_remove_configurations(wifi_dbus *handle, const gchar *config_id);
59 int wifi_configuration_set_field(wifi_dbus *handle, const gchar *config_id, const gchar *key, const gchar *value);
60 int wifi_configuration_get_passphrase(wifi_dbus *handle, const gchar *config_id, gchar **passphrase);
61
62 int wifi_save_eap_configurations(wifi_dbus *handle, const gchar *name, const gchar *passphrase, wifi_security_type_e security_type, const gchar *proxy_address, struct _wifi_eap_config *eap_config, gboolean is_hidden);
63 int wifi_load_eap_configurations(wifi_dbus *handle, const gchar *config_id, gchar **name, wifi_security_type_e *security_type, gchar **proxy_address, gboolean *is_hidden, struct _wifi_eap_config **eap_config,wifi_error_e *last_error);
64 wifi_eap_type_e wifi_eap_type_to_int(const gchar *type);
65 wifi_eap_auth_type_e wifi_eap_auth_type_to_int(const gchar *type);
66 gchar *wifi_eap_type_to_string(wifi_eap_type_e eap_type);
67 gchar *wifi_eap_auth_type_to_string(wifi_eap_auth_type_e eap_auth_type);
68
69 #endif
70