Apply device policy for wifi and wifi profile
[platform/core/connectivity/libnet-client.git] / src / include / network-dbus-request.h
1 /*
2  * Network Client Library
3  *
4  * Copyright 2012 Samsung Electronics Co., Ltd
5  *
6  * Licensed under the Flora License, Version 1.1 (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.tizenopensource.org/license
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 __NETWORK_DBUS_REQUEST_H__
21 #define __NETWORK_DBUS_REQUEST_H__
22
23 #include "network-internal.h"
24 #include "network-wifi-intf.h"
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 /*****************************************************************************
31  *      Macros and Typedefs
32  *****************************************************************************/
33
34 #define CONNMAN_CLIENT_DBUS_TYPE_STRING                 "string"
35 #define CONNMAN_CLIENT_DBUS_TYPE_INT16                  "int16"
36 #define CONNMAN_CLIENT_DBUS_TYPE_UINT16                 "uint16"
37 #define CONNMAN_CLIENT_DBUS_TYPE_INT32                  "int32"
38 #define CONNMAN_CLIENT_DBUS_TYPE_UINT32                 "uint32"
39 #define CONNMAN_CLIENT_DBUS_TYPE_INT64                  "int64"
40 #define CONNMAN_CLIENT_DBUS_TYPE_UINT64                 "uint64"
41 #define CONNMAN_CLIENT_DBUS_TYPE_DOUBLE                 "double"
42 #define CONNMAN_CLIENT_DBUS_TYPE_BYTE                   "byte"
43 #define CONNMAN_CLIENT_DBUS_TYPE_BOOLEAN                "boolean"
44 #define CONNMAN_CLIENT_DBUS_TYPE_OBJECT_PATH    "objpath"
45
46 #define CONNMAN_CLIENT_DBUS_TYPE_VARIANT                "variant"
47 #define CONNMAN_CLIENT_DBUS_TYPE_ARRAY                  "array"
48 #define CONNMAN_CLIENT_DBUS_TYPE_DICT_ENTRY             "dict"
49
50 #define NETCONFIG_AGENT_FIELD_SSID              "SSID"
51 #define NETCONFIG_AGENT_FIELD_PASSPHRASE                "Passphrase"
52 #define NETCONFIG_AGENT_FIELD_WPS_PBC                   "WPS_PBC"
53 #define NETCONFIG_AGENT_FIELD_WPS_PIN                   "WPS_PIN"
54
55 #define CONNMAN_CONFIG_FIELD_TYPE                               "Type"
56 #define CONNMAN_CONFIG_FIELD_NAME                               "Name"
57 #define CONNMAN_CONFIG_FIELD_SSID                               "SSID"
58 #define CONNMAN_CONFIG_FIELD_EAP_METHOD                 "EAP"
59 #define CONNMAN_CONFIG_FIELD_IDENTITY                   "Identity"
60 #define CONNMAN_CONFIG_FIELD_PASSPHRASE                 "Passphrase"
61 #define CONNMAN_CONFIG_FIELD_PHASE2                             "Phase2"
62 #define CONNMAN_CONFIG_FIELD_CA_CERT_FILE               "CACertFile"
63 #define CONNMAN_CONFIG_FIELD_CLIENT_CERT_FILE   "ClientCertFile"
64 #define CONNMAN_CONFIG_FIELD_PVT_KEY_FILE               "PrivateKeyFile"
65 #define CONNMAN_CONFIG_FIELD_PVT_KEY_PASSPHRASE "PrivateKeyPassphrase"
66 #define CONNMAN_CONFIG_FIELD_EAP_KEYMGMT_TYPE   "KeymgmtType"
67
68 /*****************************************************************************
69  *      Global Structures
70  *****************************************************************************/
71
72 typedef struct {
73         char *type;
74         char *mode;
75         char *ssid;
76         char *security;
77         char *passphrase;
78         char *eap_type;
79         char *eap_auth;
80         char *identity;
81         char *password;
82         char *ca_cert_file;
83         char *client_cert_file;
84         char *private_key_file;
85         char *private_key_password;
86         char *eap_keymgmt_type;
87         gboolean is_hidden;
88 } net_wifi_connect_service_info_t;
89
90 /*****************************************************************************
91  *      Global Functions
92  *****************************************************************************/
93 int _net_dbus_scan_request(void);
94 int _net_dbus_set_bgscan_mode(net_wifi_background_scan_mode_t mode);
95 int _net_dbus_get_state(char* state);
96 int _net_dbus_get_ethernet_cable_state(int *state);
97 int _net_dbus_set_agent_passphrase_and_connect(
98                 const char *passphrase, const char *profilename);
99 int _net_dbus_get_wps_pin(char **wps_pin);
100 int _net_dbus_set_agent_wps_pbc_and_connect(const char *profilename);
101 int _net_dbus_set_agent_wps_pin_and_connect(
102                 const char *wps_pin, const char *profilename);
103 int _net_dbus_open_connection(const char* profile_name);
104 int _net_dbus_close_connection(const char* profile_name);
105 int _net_dbus_get_network_status(net_device_t device_type, net_cm_network_status_t* network_status);
106 int _net_dbus_get_tech_status(net_device_t device_type, net_tech_info_t* tech_status);
107 int _net_dbus_get_wifi_state(char **wifi_state);
108 int _net_dbus_connect_service(const net_wifi_connect_service_info_t* wifi_connection_info);
109 int _net_dbus_set_profile_ipv4(net_profile_info_t* prof_info, char* profile_name);
110 int _net_dbus_set_profile_ipv6(net_profile_info_t* prof_info, char* profile_name);
111 int _net_dbus_set_profile_dns(net_profile_info_t* prof_info, char* profile_name);
112 int _net_dbus_set_proxy(net_profile_info_t* prof_info, char* profile_name);
113 int _net_dbus_get_technology_state(network_tech_state_info_t* tech_state);
114 GVariant *_net_invoke_dbus_method(const char *dest, const char *path,
115                 const char *interface_name, const char *method,
116                 GVariant *params, int *dbus_error);
117 int _net_invoke_dbus_method_nonblock(const char *dest, const char *path,
118                 const char *interface_name, const char *method,
119                 GVariant *params, int timeout,
120                 GAsyncReadyCallback notify_func);
121 int _net_dbus_load_wifi_driver(gboolean wifi_picker_test);
122 int _net_dbus_remove_wifi_driver(void);
123 int _net_dbus_get_statistics(net_device_t device_type, net_statistics_type_e statistics_type, unsigned long long *size);
124 int _net_dbus_set_statistics(net_device_t device_type, net_statistics_type_e statistics_type);
125 int _net_dbus_add_pdp_profile(net_profile_info_t *prof_info);
126 int _net_dbus_reset_pdp_profile(int type, const char * modem_path);
127 int _net_dbus_modify_pdp_profile(net_profile_info_t *prof_info, const char *profile_name);
128 int _net_dbus_specific_scan_request(const char *ssid);
129 int _net_dbus_wps_scan_request(void);
130 int _net_dbus_set_default(const char* profile_name);
131 int _net_dbus_get_passpoint(int *enabled);
132 int _net_dbus_set_passpoint(int enable);
133 #if defined TIZEN_TV
134 int _net_dbus_cancel_wps(void);
135 #endif
136
137 #if defined TIZEN_TV
138 int _net_dbus_open_connection_without_ssid();
139 int _net_dbus_open_pin_connection_without_ssid(const char *pin);
140 int _net_dbus_set_agent_wps_pbc(void);
141 int _net_dbus_set_agent_wps_pin(const char *wps_pin);
142
143 #endif
144
145 int _net_dbus_tdls_disconnect(const char* peer_mac_addr);
146 int _net_dbus_tdls_connected_peer(char** peer_mac_addr);
147
148 int _net_dbus_device_policy_get_wifi(int *state);
149 int _net_dbus_device_policy_get_wifi_profile(int *state);
150
151 #ifdef __cplusplus
152 }
153 #endif
154
155 #endif /** __NETWORK_SIGNAL_HANDLER_H__ */