Add new error (ACR-1257)
[platform/core/api/connection.git] / include / connection_profile.h
1 /*
2  * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17
18 #ifndef __TIZEN_NETWORK_CONNECTION_PROFILE_H__
19 #define __TIZEN_NETWORK_CONNECTION_PROFILE_H__
20
21
22 #include <tizen.h>
23
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29
30 /**
31  * @file connection_profile.h
32  */
33
34
35 /**
36 * @addtogroup CAPI_NETWORK_CONNECTION_WIFI_PROFILE_MODULE
37 * @{
38 */
39
40
41 /**
42  * @brief Enumeration for security type of Wi-Fi.
43  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
44 */
45 typedef enum {
46         CONNECTION_WIFI_SECURITY_TYPE_NONE = 0,         /**< Security disabled */
47         CONNECTION_WIFI_SECURITY_TYPE_WEP = 1,          /**< WEP */
48         CONNECTION_WIFI_SECURITY_TYPE_WPA_PSK = 2,      /**< WPA-PSK */
49         CONNECTION_WIFI_SECURITY_TYPE_WPA2_PSK = 3,     /**< WPA2-PSK */
50         CONNECTION_WIFI_SECURITY_TYPE_EAP = 4,          /**< EAP */
51 } connection_wifi_security_type_e;
52
53
54 /**
55  * @brief Enumeration for encryption modes.
56  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
57 */
58 typedef enum {
59         CONNECTION_WIFI_ENCRYPTION_TYPE_NONE = 0,           /**< Encryption disabled */
60         CONNECTION_WIFI_ENCRYPTION_TYPE_WEP = 1,            /**< WEP */
61         CONNECTION_WIFI_ENCRYPTION_TYPE_TKIP = 2,           /**< TKIP */
62         CONNECTION_WIFI_ENCRYPTION_TYPE_AES = 3,            /**< AES */
63         CONNECTION_WIFI_ENCRYPTION_TYPE_TKIP_AES_MIXED = 4, /**< TKIP and AES are both supported */
64 } connection_wifi_encryption_type_e;
65
66
67 /**
68 * @}
69 */
70
71
72 /**
73 * @addtogroup CAPI_NETWORK_CONNECTION_CELLULAR_PROFILE_MODULE
74 * @{
75 */
76
77
78 /**
79  * @brief Enumeration for cellular service type.
80  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
81 */
82 typedef enum {
83         CONNECTION_CELLULAR_SERVICE_TYPE_UNKNOWN = 0,          /**< Unknown */
84         CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET = 1,         /**< Internet */
85         CONNECTION_CELLULAR_SERVICE_TYPE_MMS = 2,              /**< MMS */
86         CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_INTERNET = 3, /**< Prepaid internet */
87         CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_MMS = 4,      /**< Prepaid MMS */
88         CONNECTION_CELLULAR_SERVICE_TYPE_TETHERING = 5,        /**< Tethering */
89         CONNECTION_CELLULAR_SERVICE_TYPE_APPLICATION = 6,      /**< Specific application */
90 } connection_cellular_service_type_e;
91
92
93 /**
94  * @brief Enumeration for cellular pdn type.
95  * @since_tizen 3.0
96  * @remarks Use #CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPV6 instead of
97  *          CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPv6.
98  */
99 typedef enum {
100         CONNECTION_CELLULAR_PDN_TYPE_UNKNOWN = 0,    /**< Unknown */
101         CONNECTION_CELLULAR_PDN_TYPE_IPV4 = 1,       /**< IPv4 */
102         CONNECTION_CELLULAR_PDN_TYPE_IPV6 = 2,       /**< IPv6 */
103         CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPv6 = 3,  /**< IPv4 and IPv6 (Deprecated since 4.0) */
104         CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPV6 = 4,  /**< IPv4 and IPv6 (Since 4.0) */
105 } connection_cellular_pdn_type_e;
106
107
108 /**
109  * @brief Enumeration for cellular authentication type.
110  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
111 */
112 typedef enum {
113         CONNECTION_CELLULAR_AUTH_TYPE_NONE = 0,     /**< No authentication */
114         CONNECTION_CELLULAR_AUTH_TYPE_PAP  = 1,     /**< PAP authentication */
115         CONNECTION_CELLULAR_AUTH_TYPE_CHAP = 2,     /**< CHAP authentication */
116 } connection_cellular_auth_type_e;
117
118
119 /**
120 * @}
121 */
122
123
124 /**
125 * @addtogroup CAPI_NETWORK_CONNECTION_PROFILE_MODULE
126 * @{
127 */
128
129
130 /**
131  * @brief The profile handle.
132  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
133 */
134 typedef void* connection_profile_h;
135
136
137 /**
138  * @brief Enumeration for profile state type.
139  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
140 */
141 typedef enum {
142         CONNECTION_PROFILE_STATE_DISCONNECTED = 0,   /**< Disconnected state */
143         CONNECTION_PROFILE_STATE_ASSOCIATION = 1,    /**< Association state */
144         CONNECTION_PROFILE_STATE_CONFIGURATION = 2,  /**< Configuration state */
145         CONNECTION_PROFILE_STATE_CONNECTED = 3,      /**< Connected state */
146 } connection_profile_state_e;
147
148
149 /**
150  * @brief Enumeration for address family.
151  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
152 */
153 typedef enum {
154         CONNECTION_ADDRESS_FAMILY_IPV4 = 0,    /**< IPV4 Address type */
155         CONNECTION_ADDRESS_FAMILY_IPV6 = 1,    /**< IPV6 Address type */
156 } connection_address_family_e;
157
158
159 /**
160  * @brief Enumeration for IP configuration type.
161  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
162 */
163 typedef enum {
164         /**
165          * Not defined
166          */
167         CONNECTION_IP_CONFIG_TYPE_NONE = 0,
168
169         /**
170          * Manual IP configuration
171          */
172         CONNECTION_IP_CONFIG_TYPE_STATIC  = 1,
173
174         /**
175          * Config IP using DHCP client (IPv4 Only)
176          */
177         CONNECTION_IP_CONFIG_TYPE_DYNAMIC = 2,
178
179         /**
180          * Config IP from Auto IP pool (169.254/16). Later with DHCP client, if available
181          */
182         CONNECTION_IP_CONFIG_TYPE_AUTO = 3,
183
184         /**
185          * Indicates an IP address that can not be modified (IPv4 Only)
186          */
187         CONNECTION_IP_CONFIG_TYPE_FIXED = 4,
188
189 } connection_ip_config_type_e;
190
191
192 /**
193  * @brief Enumeration for proxy method type.
194  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
195 */
196 typedef enum {
197         /**
198          * Direct connection
199          */
200         CONNECTION_PROXY_TYPE_DIRECT = 0,
201
202         /**
203          * Auto configuration (use PAC file). If URL property is not set,
204          * DHCP/WPAD auto-discover will be tried
205          */
206         CONNECTION_PROXY_TYPE_AUTO = 1,
207
208         /**
209          * Manual configuration
210          */
211         CONNECTION_PROXY_TYPE_MANUAL  = 2,
212
213 } connection_proxy_type_e;
214
215 /**
216  * @brief Enumeration for DNS configuration type.
217  * @since_tizen 4.0
218  */
219 typedef enum {
220         CONNECTION_DNS_CONFIG_TYPE_NONE = 0,     /**< Not defined */
221         CONNECTION_DNS_CONFIG_TYPE_STATIC = 1,   /**< Manual DNS configuration */
222         CONNECTION_DNS_CONFIG_TYPE_DYNAMIC = 2,  /**< Config DNS using DHCP client */
223 } connection_dns_config_type_e;
224
225 /**
226  * @brief Enumeration for network connection type.
227  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
228 */
229 typedef enum {
230         CONNECTION_PROFILE_TYPE_CELLULAR = 0,    /**< Cellular type */
231         CONNECTION_PROFILE_TYPE_WIFI = 1,        /**< Wi-Fi type */
232         CONNECTION_PROFILE_TYPE_ETHERNET = 2,    /**< Ethernet type */
233         CONNECTION_PROFILE_TYPE_BT = 3,          /**< Bluetooth type */
234 } connection_profile_type_e;
235
236
237 /**
238  * @brief Creates a profile handle.
239  * @details The profile name, which you get from connection_profile_get_name()
240  *          will include the keyword you set.
241  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
242  * @privlevel public
243  * @privilege %http://tizen.org/privilege/network.get
244  * @remarks You must release @a profile using connection_profile_destroy().
245  * @param[in] type               The type of profile \n
246  *            #CONNECTION_PROFILE_TYPE_CELLULAR and #CONNECTION_PROFILE_TYPE_WIFI are supported
247  * @param[in] keyword            The keyword included in profile name
248  * @param[out] profile           The handle of the profile
249  * @return @c 0 on success,
250  *         otherwise negative error value
251  * @retval #CONNECTION_ERROR_NONE                  Successful
252  * @retval #CONNECTION_ERROR_NOT_INITIALIZED       Not initialized
253  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
254  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY         Out of memory
255  * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
256  * @retval #CONNECTION_ERROR_NOT_SUPPORTED         Not supported
257  * @see connection_profile_destroy()
258  * @see connection_profile_get_name()
259 */
260 int connection_profile_create(connection_profile_type_e type,
261                 const char *keyword, connection_profile_h *profile);
262
263
264 /**
265  * @brief Destroys a profile handle.
266  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
267  * @param[out] profile           The handle to the profile
268  * @return @c 0 on success,
269  *         otherwise a negative error value
270  * @retval #CONNECTION_ERROR_NONE                  Successful
271  * @retval #CONNECTION_ERROR_NOT_INITIALIZED       Not initialized
272  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
273  * @see connection_profile_create()
274 */
275 int connection_profile_destroy(connection_profile_h profile);
276
277
278 /**
279  * @brief Clones a profile handle.
280  * @since_tizen 2.3
281  * @remarks You must release @a cloned_profile using connection_profile_destroy().
282  * @param[out] cloned_profile    The handle of the cloned profile
283  * @param[in] origin_profile     The handle of the origin profile
284  * @return @c 0 on success,
285  *         otherwise a negative error value
286  * @retval #CONNECTION_ERROR_NONE                  Successful
287  * @retval #CONNECTION_ERROR_NOT_INITIALIZED       Not initialized
288  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
289  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY         Out of memory
290  * @see connection_profile_destroy()
291 */
292 int connection_profile_clone(connection_profile_h *cloned_profile,
293                 connection_profile_h origin_profile);
294
295
296 /**
297  * @brief Gets the profile ID.
298  * @details The separate profiles can have the same name.
299  *          So, you must use this function instead of connection_profile_get_name()
300  *          if you want to get the unique identification.
301  *          In case you create a profile, this value will be determined when you add the profile.
302  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
303  * @remarks You must release @a profile_id using free().
304  * @param[in] profile            The profile handle
305  * @param[out] profile_id        The ID of the profile
306  * @return @c 0 on success,
307  *         otherwise a negative error value
308  * @retval #CONNECTION_ERROR_NONE                  Successful
309  * @retval #CONNECTION_ERROR_NOT_INITIALIZED       Not initialized
310  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
311  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY         Out of memory
312  * @see connection_profile_get_name()
313  * @see connection_add_profile()
314 */
315 int connection_profile_get_id(connection_profile_h profile, char **profile_id);
316
317
318 /**
319  * @brief Gets the profile name.
320  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
321  * @remarks You must release @a profile_name using free().
322  * @param[in] profile           The profile handle
323  * @param[out] profile_name     The name of the profile
324  * @return @c 0 on success,
325  *         otherwise a negative error value
326  * @retval #CONNECTION_ERROR_NONE                  Successful
327  * @retval #CONNECTION_ERROR_NOT_INITIALIZED       Not initialized
328  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
329  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY         Out of memory
330  * @see connection_profile_get_id()
331 */
332 int connection_profile_get_name(connection_profile_h profile, char **profile_name);
333
334
335 /**
336  * @brief Gets the network type.
337  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
338  * @param[in] profile           The profile handle
339  * @param[out] type             The type of the profile
340  * @return @c 0 on success,
341  *         otherwise a negative error value
342  * @retval #CONNECTION_ERROR_NONE                  Successful
343  * @retval #CONNECTION_ERROR_NOT_INITIALIZED       Not initialized
344  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
345  * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
346 */
347 int connection_profile_get_type(connection_profile_h profile, connection_profile_type_e *type);
348
349
350 /**
351  * @brief Gets the name of the network interface, e.g. eth0 and pdp0.
352  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
353  * @remarks You must release @a interface_name using free().
354  * @param[in] profile           The profile handle
355  * @param[out] interface_name   The name of the network interface
356  * @return @c 0 on success,
357  *         otherwise a negative error value
358  * @retval #CONNECTION_ERROR_NONE                  Successful
359  * @retval #CONNECTION_ERROR_NOT_INITIALIZED       Not initialized
360  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
361  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY         Out of memory
362 */
363 int connection_profile_get_network_interface_name(connection_profile_h profile,
364                 char **interface_name);
365
366
367 /**
368  * @brief Refreshes the profile information.
369  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
370  * @privlevel public
371  * @privilege %http://tizen.org/privilege/network.get
372  * @remarks You should call this function in order to get the current information
373  *          because the profile information can be changed.
374  * @param[in] profile           The profile handle
375  * @return @c 0 on success,
376  *         otherwise a negative error value
377  * @retval #CONNECTION_ERROR_NONE                  Successful
378  * @retval #CONNECTION_ERROR_NOT_INITIALIZED       Not initialized
379  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
380  * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
381  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY         Out of memory
382  * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
383 */
384 int connection_profile_refresh(connection_profile_h profile);
385
386
387 /**
388  * @brief Gets the network state.
389  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
390  * @param[in] profile           The profile handle
391  * @param[out] state            The state of the profile
392  * @return @c 0 on success,
393  *         otherwise a negative error value
394  * @retval #CONNECTION_ERROR_NONE                  Successful
395  * @retval #CONNECTION_ERROR_NOT_INITIALIZED       Not initialized
396  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
397  * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
398 */
399 int connection_profile_get_state(connection_profile_h profile,
400                 connection_profile_state_e *state);
401
402
403 /**
404  * @brief Gets the IP config type.
405  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
406  * @param[in] profile           The profile handle
407  * @param[in] address_family    The address family
408  * @param[out] type             The type of the IP config
409  * @return @c 0 on success,
410  *         otherwise a negative error value
411  * @retval #CONNECTION_ERROR_NONE                  Successful
412  * @retval #CONNECTION_ERROR_NOT_INITIALIZED       Not initialized
413  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
414  * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
415 */
416 int connection_profile_get_ip_config_type(connection_profile_h profile,
417                 connection_address_family_e address_family, connection_ip_config_type_e *type);
418
419
420 /**
421  * @brief Gets the IP address.
422  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
423  * @remarks You must release @a ip_address using free().
424  * @param[in] profile           The profile handle
425  * @param[in] address_family    The address family
426  * @param[out] ip_address       The IP address
427  * @return @c 0 on success,
428  *         otherwise a negative error value
429  * @retval #CONNECTION_ERROR_NONE                           Successful
430  * @retval #CONNECTION_ERROR_NOT_INITIALIZED                Not initialized
431  * @retval #CONNECTION_ERROR_INVALID_PARAMETER              Invalid parameter
432  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY                  Out of memory
433  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
434  * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
435 */
436 int connection_profile_get_ip_address(connection_profile_h profile,
437                 connection_address_family_e address_family, char **ip_address);
438
439
440 /**
441  * @brief Gets the Subnet Mask.
442  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
443  * @remarks You must release @a subnet_mask using free().
444  *          This function is supported only for IPv4 address family.
445  * @param[in] profile           The profile handle
446  * @param[in] address_family    The address family
447  * @param[out] subnet_mask      The subnet mask
448  * @return @c 0 on success,
449  *         otherwise a negative error value
450  * @retval #CONNECTION_ERROR_NONE                           Successful
451  * @retval #CONNECTION_ERROR_NOT_INITIALIZED                Not initialized
452  * @retval #CONNECTION_ERROR_INVALID_PARAMETER              Invalid parameter
453  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY                  Out of memory
454  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
455  * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
456 */
457 int connection_profile_get_subnet_mask(connection_profile_h profile,
458                 connection_address_family_e address_family, char **subnet_mask);
459
460
461 /**
462  * @brief Gets the Gateway address.
463  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
464  * @remarks You must release @a gateway_address using free().
465  * @param[in] profile           The profile handle
466  * @param[in] address_family    The address family
467  * @param[out] gateway_address  The gateway address
468  * @return @c 0 on success,
469  *         otherwise a negative error value
470  * @retval #CONNECTION_ERROR_NONE                           Successful
471  * @retval #CONNECTION_ERROR_NOT_INITIALIZED                Not initialized
472  * @retval #CONNECTION_ERROR_INVALID_PARAMETER              Invalid parameter
473  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY                  Out of memory
474  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
475  * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
476 */
477 int connection_profile_get_gateway_address(connection_profile_h profile,
478                 connection_address_family_e address_family, char **gateway_address);
479
480 /**
481  * @brief Gets the DHCP Server address.
482  * @since_tizen 4.0
483  * @remarks You must release @a dhcp_server using free().
484  *          This function is supported only for IPv4 address family.
485  * @param[in] profile           The profile handle
486  * @param[in] address_family    The address family
487  * @param[out] dhcp_server      The DHCP Server address
488  * @return @c 0 on success, otherwise a negative error value
489  * @retval #CONNECTION_ERROR_NONE                           Successful
490  * @retval #CONNECTION_ERROR_NOT_INITIALIZED                Not initialized
491  * @retval #CONNECTION_ERROR_INVALID_PARAMETER              Invalid parameter
492  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY                  Out of memory
493  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
494  * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
495 */
496 int connection_profile_get_dhcp_server_address(connection_profile_h profile,
497                 connection_address_family_e address_family, char **dhcp_server);
498
499 /**
500  * @brief Gets the DHCP lease duration.
501  * @since_tizen 4.0
502  * @param[in] profile                   The profile handle
503  * @param[in] address_family            The address family
504  * @param[out] dhcp_lease_duration      The DHCP lease duration in seconds
505  * @return @c 0 on success, otherwise a negative error value
506  * @retval #CONNECTION_ERROR_NONE                           Successful
507  * @retval #CONNECTION_ERROR_NOT_INITIALIZED                Not initialized
508  * @retval #CONNECTION_ERROR_INVALID_PARAMETER              Invalid parameter
509  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
510  * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
511  * @retval #CONNECTION_ERROR_NOT_SUPPORTED                  Not supported
512 */
513 int connection_profile_get_dhcp_lease_duration(connection_profile_h profile,
514                 connection_address_family_e address_family, int *dhcp_lease_duration);
515
516 /**
517  * @brief Gets the DNS address.
518  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
519  * @remarks The allowance of the DNS address is @c 2. You must release @a dns_address using free().
520  * @param[in] profile           The profile handle
521  * @param[in] order             The order of DNS address \n
522  *            It starts from 1, which means first DNS address
523  * @param[in] address_family    The address family
524  * @param[out] dns_address      The DNS address
525  * @return @c 0 on success,
526  *         otherwise a negative error value
527  * @retval #CONNECTION_ERROR_NONE                           Successful
528  * @retval #CONNECTION_ERROR_NOT_INITIALIZED                Not initialized
529  * @retval #CONNECTION_ERROR_INVALID_PARAMETER              Invalid parameter
530  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY                  Out of memory
531  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
532  * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
533 */
534 int connection_profile_get_dns_address(connection_profile_h profile,
535                 int order, connection_address_family_e address_family, char **dns_address);
536
537
538 /**
539  * @brief Gets the Proxy type.
540  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
541  * @param[in] profile           The profile handle
542  * @param[out] type             The type of the proxy
543  * @return @c 0 on success,
544  *         otherwise a negative error value
545  * @retval #CONNECTION_ERROR_NONE                  Successful
546  * @retval #CONNECTION_ERROR_NOT_INITIALIZED       Not initialized
547  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
548  * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
549 */
550 int connection_profile_get_proxy_type(connection_profile_h profile,
551                 connection_proxy_type_e *type);
552
553
554 /**
555  * @brief Gets the Proxy address.
556  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
557  * @remarks You must release @a proxy_address using free().
558  * @param[in] profile           The profile handle
559  * @param[in] address_family    The address family
560  * @param[out] proxy_address    The proxy address
561  * @return @c 0 on success,
562  *         otherwise a negative error value
563  * @retval #CONNECTION_ERROR_NONE                           Successful
564  * @retval #CONNECTION_ERROR_NOT_INITIALIZED                Not initialized
565  * @retval #CONNECTION_ERROR_INVALID_PARAMETER              Invalid parameter
566  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY                  Out of memory
567  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
568  * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
569 */
570 int connection_profile_get_proxy_address(connection_profile_h profile,
571                 connection_address_family_e address_family, char **proxy_address);
572
573
574 /**
575  * @brief Sets the IP config type.
576  * @details If you set IP config type to #CONNECTION_IP_CONFIG_TYPE_STATIC,
577  *          then IP address, Gateway and Subnet mask will be set to the initial value "0.0.0.0".
578  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
579  * @param[in] profile           The profile handle
580  * @param[in] address_family    The address family
581  * @param[in] type              The type of the IP config
582  * @return @c 0 on success,
583  *         otherwise a negative error value
584  * @retval #CONNECTION_ERROR_NONE                  Successful
585  * @retval #CONNECTION_ERROR_NOT_INITIALIZED       Not initialized
586  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
587  * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
588 */
589 int connection_profile_set_ip_config_type(connection_profile_h profile,
590                 connection_address_family_e address_family, connection_ip_config_type_e type);
591
592
593 /**
594  * @brief Sets the IP address.
595  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
596  * @remarks You must release @a ip_address using free().
597  * @param[in] profile           The profile handle
598  * @param[in] address_family    The address family
599  * @param[in] ip_address        The IP address \n
600  *            If you set this value to @c NULL, then the existing value will be deleted
601  * @return @c 0 on success,
602  *         otherwise a negative error value
603  * @retval #CONNECTION_ERROR_NONE                           Successful
604  * @retval #CONNECTION_ERROR_NOT_INITIALIZED                Not initialized
605  * @retval #CONNECTION_ERROR_INVALID_PARAMETER              Invalid parameter
606  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
607  * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
608  * @see connection_update_profile()
609 */
610 int connection_profile_set_ip_address(connection_profile_h profile,
611                 connection_address_family_e address_family, const char *ip_address);
612
613
614 /**
615  * @brief Sets the Subnet Mask.
616  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
617  * @remarks You must release @a subnet_mask using free().
618  *          This function is supported only for IPv4 address family.
619  * @param[in] profile           The profile handle
620  * @param[in] address_family    The address family
621  * @param[in] subnet_mask       The subnet mask \n
622  *            If you set this value to @c NULL, then the existing value will be deleted
623  * @return @c 0 on success,
624  *         otherwise a negative error value
625  * @retval #CONNECTION_ERROR_NONE                           Successful
626  * @retval #CONNECTION_ERROR_NOT_INITIALIZED                Not initialized
627  * @retval #CONNECTION_ERROR_INVALID_PARAMETER              Invalid parameter
628  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
629  * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
630  * @see connection_update_profile()
631 */
632 int connection_profile_set_subnet_mask(connection_profile_h profile,
633                 connection_address_family_e address_family, const char *subnet_mask);
634
635
636 /**
637  * @brief Sets the Gateway address.
638  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
639  * @remarks You must release @a gateway_address using free().
640  * @param[in] profile           The profile handle
641  * @param[in] address_family    The address family
642  * @param[in] gateway_address   The gateway address \n
643  *            If you set this value to @c NULL, then the existing value will be deleted
644  * @return @c 0 on success,
645  *         otherwise a negative error value
646  * @retval #CONNECTION_ERROR_NONE                           Successful
647  * @retval #CONNECTION_ERROR_NOT_INITIALIZED                Not initialized
648  * @retval #CONNECTION_ERROR_INVALID_PARAMETER              Invalid parameter
649  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
650  * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
651  * @see connection_update_profile()
652 */
653 int connection_profile_set_gateway_address(connection_profile_h profile,
654                 connection_address_family_e address_family, const char *gateway_address);
655
656
657 /**
658  * @brief Sets the DNS address.
659  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
660  * @remarks The allowance of the DNS address is @c 2.
661  * @remarks You must release @a dns_address using free().
662  * @param[in] profile           The profile handle
663  * @param[in] order             The order of the DNS address \n
664  *            It starts from @c 1, which means first DNS address
665  * @param[in] address_family    The address family
666  * @param[in] dns_address       The DNS address \n
667  *            If you set this value to NULL then the existing value will be deleted
668  * @return @c 0 on success,
669  *         otherwise a negative error value
670  * @retval #CONNECTION_ERROR_NONE                           Successful
671  * @retval #CONNECTION_ERROR_NOT_INITIALIZED                Not initialized
672  * @retval #CONNECTION_ERROR_INVALID_PARAMETER              Invalid parameter
673  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
674  * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
675  * @see connection_update_profile()
676 */
677 int connection_profile_set_dns_address(connection_profile_h profile,
678                 int order, connection_address_family_e address_family, const char *dns_address);
679
680
681 /**
682  * @brief Sets the Proxy type.
683  * @details If you set the Proxy type to #CONNECTION_PROXY_TYPE_AUTO or
684  *          #CONNECTION_PROXY_TYPE_MANUAL, then Proxy will be restored.
685  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
686  * @param[in] profile           The profile handle
687  * @param[in] type              The type of the proxy
688  * @return @c 0 on success,
689  *         otherwise a negative error value
690  * @retval #CONNECTION_ERROR_NONE                  Successful
691  * @retval #CONNECTION_ERROR_NOT_INITIALIZED       Not initialized
692  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
693  * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
694  * @see connection_update_profile()
695 */
696 int connection_profile_set_proxy_type(connection_profile_h profile,
697                 connection_proxy_type_e type);
698
699
700 /**
701  * @brief Sets the Proxy address.
702  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
703  * @remarks You must release @a proxy_address using free().
704  * @param[in] profile           The profile handle
705  * @param[in] address_family    The address family
706  * @param[in] proxy_address     The proxy address \n
707  *            If you set this value to @c NULL, then the existing value will be deleted
708  * @return @c 0 on success,
709  *         otherwise a negative error value
710  * @retval #CONNECTION_ERROR_NONE                           Successful
711  * @retval #CONNECTION_ERROR_NOT_INITIALIZED                Not initialized
712  * @retval #CONNECTION_ERROR_INVALID_PARAMETER              Invalid parameter
713  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
714  * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
715  * @see connection_update_profile()
716 */
717 int connection_profile_set_proxy_address(connection_profile_h profile,
718                 connection_address_family_e address_family, const char *proxy_address);
719
720
721 /**
722  * @brief Called when the state of the profile is changed.
723  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
724  * @param[in] state             The state
725  * @param[in] user_data         The user data passed from the callback registration function
726  * @see connection_profile_set_state_changed_cb()
727  * @see connection_profile_unset_state_changed_cb()
728 */
729 typedef void(*connection_profile_state_changed_cb)(connection_profile_state_e state,
730                 void *user_data);
731
732
733 /**
734  * @brief Sets the callback that is called when the state of profile is changed.
735  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
736  * @param[in] profile           The profile handle
737  * @param[in] callback          The callback function to be called
738  * @param[in] user_data         The user data passed to the callback function
739  * @return @c 0 on success,
740  *         otherwise a negative error value
741  * @retval #CONNECTION_ERROR_NONE                  Successful
742  * @retval #CONNECTION_ERROR_NOT_INITIALIZED       Not initialized
743  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
744  * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
745  * @post connection_opened_cb() is invoked when the state of profile is changed.
746  * @see connection_profile_state_changed_cb()
747  * @see connection_profile_unset_state_changed_cb()
748 */
749 int connection_profile_set_state_changed_cb(connection_profile_h profile,
750                 connection_profile_state_changed_cb callback, void *user_data);
751
752
753 /**
754  * @brief Unsets the callback that is called when the state of profile is changed.
755  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
756  * @param[in] profile           The profile handle
757  * @return @c 0 on success,
758  *         otherwise a negative error value
759  * @retval #CONNECTION_ERROR_NONE                  Successful
760  * @retval #CONNECTION_ERROR_NOT_INITIALIZED       Not initialized
761  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
762  * @see connection_profile_state_changed_cb()
763  * @see connection_profile_set_state_changed_cb()
764 */
765 int connection_profile_unset_state_changed_cb(connection_profile_h profile);
766
767 /**
768  * @brief Gets the IPv6 network state.
769  * @since_tizen 4.0
770  * @param[in] profile           The profile handle
771  * @param[out] state            The profile state
772  * @return 0 on success, otherwise negative error value
773  * @retval #CONNECTION_ERROR_NONE                  Successful
774  * @retval #CONNECTION_ERROR_NOT_INITIALIZED       Not initialized
775  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
776  * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
777  * @retval #CONNECTION_ERROR_NOT_SUPPORTED         Not supported
778  */
779 int connection_profile_get_ipv6_state(connection_profile_h profile,
780                 connection_profile_state_e *state);
781
782 /**
783  * @brief Sets the DNS config type.
784  * @since_tizen 4.0
785  * @param[in] profile         The profile handle
786  * @param[in] address_family  The address family
787  * @param[in] type            The DNS config type
788  * @return 0 on success, otherwise negative error value
789  * @retval #CONNECTION_ERROR_NONE               Successful
790  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
791  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
792  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
793  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
794  */
795 int connection_profile_set_dns_config_type(connection_profile_h profile,
796                 connection_address_family_e address_family, connection_dns_config_type_e type);
797
798 /**
799  * @brief Gets the DNS config type.
800  * @since_tizen 4.0
801  * @param[in] profile         The profile handle
802  * @param[in] address_family  The address family
803  * @param[out] type           The DNS config type
804  * @return 0 on success, otherwise negative error value
805  * @retval #CONNECTION_ERROR_NONE               Successful
806  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
807  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
808  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
809  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
810  */
811 int connection_profile_get_dns_config_type(connection_profile_h profile,
812                 connection_address_family_e address_family, connection_dns_config_type_e *type);
813
814 /**
815  * @brief Gets the network prefix length.
816  * @since_tizen 4.0
817  * @param[in] profile         The profile handle
818  * @param[in] address_family  The address family
819  * @param[out] prefix_len     The network prefix length \n
820  *                            In case of IPv4, it means netmask length
821  *                            (also called a prefix, e.g. 8, 16, 24, 32)
822  * @return 0 on success, otherwise negative error value.
823  * @retval #CONNECTION_ERROR_NONE               Successful
824  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
825  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
826  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
827  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
828  */
829 int connection_profile_get_prefix_length(connection_profile_h profile,
830                 connection_address_family_e address_family, int *prefix_len);
831
832 /**
833  * @brief Sets the network prefix length.
834  * @since_tizen 4.0
835  * @param[in] profile         The profile handle
836  * @param[in] address_family  The address family
837  * @param[in] prefix_len      The network prefix length
838  *                            In case of IPv4, it means netmask length
839  *                            (also called a prefix, e.g. 8, 16, 24, 32)
840  * @return 0 on success, otherwise negative error value
841  * @retval #CONNECTION_ERROR_NONE               Successful
842  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
843  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
844  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
845  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
846  * @see connection_update_profile()
847  */
848 int connection_profile_set_prefix_length(connection_profile_h profile,
849                 connection_address_family_e address_family, int prefix_len);
850
851 /**
852 * @}
853 */
854
855
856 /**
857 * @addtogroup CAPI_NETWORK_CONNECTION_WIFI_PROFILE_MODULE
858 * @{
859 */
860
861
862 /**
863  * @brief Gets the ESSID (Extended Service Set Identifier).
864  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
865  * @remarks You must release @a essid using free().
866  * @param[in] profile         The profile handle
867  * @param[out] essid          The ESSID
868  * @return @c 0 on success,
869  *         otherwise a negative error value
870  * @retval #CONNECTION_ERROR_NONE               Successful
871  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
872  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
873  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY      Out of memory
874  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
875 */
876 int connection_profile_get_wifi_essid(connection_profile_h profile, char **essid);
877
878
879 /**
880  * @brief Gets the BSSID (Basic Service Set Identifier).
881  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
882  * @remarks You must release @a bssid using free().
883  * @param[in] profile         The profile handle
884  * @param[out] bssid          The BSSID
885  * @return @c 0 on success,
886  *         otherwise a negative error value
887  * @retval #CONNECTION_ERROR_NONE               Successful
888  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
889  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
890  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY      Out of memory
891  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
892 */
893 int connection_profile_get_wifi_bssid(connection_profile_h profile, char **bssid);
894
895
896 /**
897  * @brief Gets the RSSI.
898  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
899  * @param[in] profile         The profile handle
900  * @param[out] rssi           The RSSI
901  * @return @c 0 on success,
902  *         otherwise a negative error value
903  * @retval #CONNECTION_ERROR_NONE               Successful
904  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
905  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
906  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
907 */
908 int connection_profile_get_wifi_rssi(connection_profile_h profile, int *rssi);
909
910
911 /**
912  * @brief Gets the frequency (MHz).
913  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
914  * @param[in] profile         The profile handle
915  * @param[out] frequency      The frequency
916  * @return @c 0 on success,
917  *         otherwise a negative error value
918  * @retval #CONNECTION_ERROR_NONE               Successful
919  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
920  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
921  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
922 */
923 int connection_profile_get_wifi_frequency(connection_profile_h profile, int *frequency);
924
925
926 /**
927  * @brief Gets the max speed (Mbps).
928  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
929  * @param[in] profile         The profile handle
930  * @param[out] max_speed      The max speed
931  * @return @c 0 on success,
932  *         otherwise a negative error value
933  * @retval #CONNECTION_ERROR_NONE               Successful
934  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
935  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
936  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
937 */
938 int connection_profile_get_wifi_max_speed(connection_profile_h profile, int *max_speed);
939
940
941 /**
942  * @brief Gets the security type of Wi-Fi.
943  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
944  * @param[in] profile         The profile handle
945  * @param[out] type           The type of Wi-Fi security
946  * @return @c 0 on success,
947  *         otherwise a negative error value
948  * @retval #CONNECTION_ERROR_NONE               Successful
949  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
950  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
951  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
952  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
953 */
954 int connection_profile_get_wifi_security_type(connection_profile_h profile,
955                 connection_wifi_security_type_e *type);
956
957
958 /**
959  * @brief Gets the encryption type of Wi-Fi.
960  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
961  * @param[in] profile         The profile handle
962  * @param[out] type           The type of Wi-Fi security
963  * @return @c 0 on success,
964  *         otherwise a negative error value
965  * @retval #CONNECTION_ERROR_NONE               Successful
966  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
967  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
968  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
969  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
970 */
971 int connection_profile_get_wifi_encryption_type(connection_profile_h profile,
972                 connection_wifi_encryption_type_e *type);
973
974
975 /**
976  * @brief Checks whether passphrase is required.
977  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
978  * @remarks This function is not valid if security type is #CONNECTION_WIFI_SECURITY_TYPE_EAP.
979  * @param[in] profile         The profile handle
980  * @param[out] required       @c true if a passphrase is required,
981  *                            otherwise @c false if a passphrase is not required
982  * @return @c 0 on success,
983  *         otherwise a negative error value
984  * @retval #CONNECTION_ERROR_NONE               Successful
985  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
986  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
987  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
988 */
989 int connection_profile_is_wifi_passphrase_required(connection_profile_h profile,
990                 bool *required);
991
992
993 /**
994  * @brief Sets the passphrase of the Wi-Fi WPA.
995  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
996  * @remarks You must release @a passphrase using free().
997  * @param[in] profile         The profile handle
998  * @param[in] passphrase      The passphrase of Wi-Fi security
999  * @return @c 0 on success,
1000  *         otherwise a negative error value
1001  * @retval #CONNECTION_ERROR_NONE               Successful
1002  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
1003  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1004  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1005  * @see connection_update_profile()
1006 */
1007 int connection_profile_set_wifi_passphrase(connection_profile_h profile,
1008                 const char *passphrase);
1009
1010
1011 /**
1012  * @brief Checks whether the WPS (Wi-Fi Protected Setup) is supported.
1013  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1014  * @remarks If WPS is supported, you can connect the access point with WPS by wifi_connect_with_wps().
1015  * @param[in] profile         The profile handle
1016  * @param[out] supported      @c true if WPS is supported,
1017  *                            otherwise @c false if WPS is not supported
1018  * @return @c 0 on success,
1019  *         otherwise negative error value
1020  * @retval #CONNECTION_ERROR_NONE               Successful
1021  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
1022  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1023  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1024 */
1025 int connection_profile_is_wifi_wps_supported(connection_profile_h profile,
1026                 bool *supported);
1027
1028
1029 /**
1030 * @}
1031 */
1032
1033
1034 /**
1035 * @addtogroup CAPI_NETWORK_CONNECTION_CELLULAR_PROFILE_MODULE
1036 * @{
1037 */
1038
1039
1040 /**
1041  * @brief Gets the service type.
1042  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1043  * @param[in] profile         The profile handle
1044  * @param[out] type           The type of the cellular service
1045  * @return @c 0 on success,
1046  *         otherwise a negative error value
1047  * @retval #CONNECTION_ERROR_NONE               Successful
1048  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
1049  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1050  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
1051  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1052 */
1053 int connection_profile_get_cellular_service_type(connection_profile_h profile,
1054                 connection_cellular_service_type_e *type);
1055
1056
1057 /**
1058  * @brief Gets the APN (access point name).
1059  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1060  * @remarks You must release @a apn using free().
1061  * @param[in] profile         The profile handle
1062  * @param[out] apn            The name of the APN
1063  * @return @c 0 on success,
1064  *         otherwise a negative error value
1065  * @retval #CONNECTION_ERROR_NONE               Successful
1066  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
1067  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1068  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY      Out of memory
1069  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1070 */
1071 int connection_profile_get_cellular_apn(connection_profile_h profile, char **apn);
1072
1073
1074 /**
1075  * @brief Gets the authentication information.
1076  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1077  * @remarks You must release @a user_name and @a password using free().
1078  * @param[in] profile         The profile handle
1079  * @param[out] type           The type of the authentication
1080  * @param[out] user_name      The user name
1081  * @param[out] password       The password
1082  * @return @c 0 on success,
1083  *         otherwise a negative error value
1084  * @retval #CONNECTION_ERROR_NONE               Successful
1085  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
1086  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1087  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY      Out of memory
1088  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
1089  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1090 */
1091 int connection_profile_get_cellular_auth_info(connection_profile_h profile,
1092                 connection_cellular_auth_type_e *type, char **user_name, char **password);
1093
1094
1095 /**
1096  * @brief Gets the home URL.
1097  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1098  * @remarks You must release @a home_url using free().
1099  * @param[in] profile         The profile handle
1100  * @param[out] home_url       The home URL
1101  * @return @c 0 on success,
1102  *         otherwise a negative error value
1103  * @retval #CONNECTION_ERROR_NONE               Successful
1104  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
1105  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1106  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY      Out of memory
1107  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1108 */
1109 int connection_profile_get_cellular_home_url(connection_profile_h profile,
1110                 char **home_url);
1111
1112
1113 /**
1114  * @brief Gets the cellular pdn type.
1115  * @since_tizen 3.0
1116  * @param[in] profile         The profile handle
1117  * @param[out] type           The cellular pdn type
1118  * @return @c 0 on success,
1119  *         otherwise negative error value
1120  * @retval #CONNECTION_ERROR_NONE               Successful
1121  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
1122  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1123  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
1124  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1125 */
1126 int connection_profile_get_cellular_pdn_type(connection_profile_h profile,
1127                 connection_cellular_pdn_type_e *type);
1128
1129
1130 /**
1131  * @brief Gets the cellular roam pdn type.
1132  * @since_tizen 3.0
1133  * @param[in] profile         The profile handle
1134  * @param[out] type           The cellular pdn type
1135  * @return @c 0 on success,
1136  *         otherwise negative error value
1137  * @retval #CONNECTION_ERROR_NONE               Successful
1138  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
1139  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1140  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
1141  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1142 */
1143 int connection_profile_get_cellular_roam_pdn_type(connection_profile_h profile,
1144                 connection_cellular_pdn_type_e *type);
1145
1146
1147 /**
1148  * @brief Checks whether the connection is in roaming state.
1149  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1150  * @param[in] profile         The profile handle
1151  * @param[out] is_roaming     @c true if the cellular is roaming,
1152  *                            otherwise @c false if it is not roaming
1153  * @return @c 0 on success,
1154  *         otherwise a negative error value
1155  * @retval #CONNECTION_ERROR_NONE               Successful
1156  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
1157  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1158  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1159 */
1160 int connection_profile_is_cellular_roaming(connection_profile_h profile,
1161                 bool *is_roaming);
1162
1163
1164 /**
1165  * @brief Checks whether the profile is hidden.
1166  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1167  * @param[in] profile         The profile handle
1168  * @param[out] is_hidden      @c true if the profile is in hidden,
1169  *                            otherwise @c false if the profile is not hidden
1170  * @return @c 0 on success,
1171  *         otherwise a negative error value
1172  * @retval #CONNECTION_ERROR_NONE               Successful
1173  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
1174  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1175  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1176 */
1177 int connection_profile_is_cellular_hidden(connection_profile_h profile,
1178                 bool *is_hidden);
1179
1180
1181 /**
1182  * @brief Checks whether the profile is editable.
1183  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1184  * @param[in] profile         The profile handle
1185  * @param[out] is_editable    @c true if the profile is editable,
1186  *                            otherwise @c false if the profile is not editable
1187  * @return @c 0 on success,
1188  *         otherwise a negative error value
1189  * @retval #CONNECTION_ERROR_NONE               Successful
1190  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
1191  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1192  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1193 */
1194 int connection_profile_is_cellular_editable(connection_profile_h profile,
1195                 bool *is_editable);
1196
1197
1198 /**
1199  * @brief Checks whether the profile is default.
1200  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1201  * @param[in] profile         The profile handle
1202  * @param[out] is_default     @c true if the profile is default,
1203  *                            otherwise @c false if the profile is not default
1204  * @return @c 0 on success,
1205  *         otherwise a negative error value
1206  * @retval #CONNECTION_ERROR_NONE               Successful
1207  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
1208  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1209  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1210 */
1211 int connection_profile_is_cellular_default(connection_profile_h profile,
1212                 bool *is_default);
1213
1214
1215 /**
1216  * @brief Sets the service type.
1217  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1218  * @param[in] profile         The profile handle
1219  * @param[in] service_type    The type of cellular service
1220  * @return @c 0 on success,
1221  *         otherwise a negative error value
1222  * @retval #CONNECTION_ERROR_NONE               Successful
1223  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
1224  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1225  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1226  * @see connection_update_profile()
1227 */
1228 int connection_profile_set_cellular_service_type(connection_profile_h profile,
1229                 connection_cellular_service_type_e service_type);
1230
1231
1232 /**
1233  * @brief Sets the APN (Access Point Name).
1234  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1235  * @remarks You must release @a apn using free().
1236  * @param[in] profile         The profile handle
1237  * @param[in] apn             The name of APN
1238  * @return @c 0 on success,
1239  *         otherwise a negative error value
1240  * @retval #CONNECTION_ERROR_NONE               Successful
1241  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
1242  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1243  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1244  * @see connection_update_profile()
1245 */
1246 int connection_profile_set_cellular_apn(connection_profile_h profile, const char *apn);
1247
1248
1249 /**
1250  * @brief Sets the Authentication information.
1251  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1252  * @remarks You must release @a user_name using free().
1253  * @param[in] profile         The profile handle
1254  * @param[in] type            The type of the authentication
1255  * @param[in] user_name       The user name
1256  * @param[in] password        The password
1257  * @return @c 0 on success,
1258  *         otherwise a negative error value
1259  * @retval #CONNECTION_ERROR_NONE               Successful
1260  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
1261  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1262  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1263  * @see connection_update_profile()
1264 */
1265 int connection_profile_set_cellular_auth_info(connection_profile_h profile,
1266                 connection_cellular_auth_type_e type, const char *user_name, const char *password);
1267
1268
1269 /**
1270  * @brief Sets the home URL.
1271  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1272  * @remarks You must release @a home_url using free().
1273  * @param[in] profile         The profile handle
1274  * @param[in] home_url        The home URL
1275  * @return @c 0 on success,
1276  *         otherwise a negative error value
1277  * @retval #CONNECTION_ERROR_NONE               Successful
1278  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
1279  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1280  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1281  * @see connection_update_profile()
1282 */
1283 int connection_profile_set_cellular_home_url(connection_profile_h profile,
1284                 const char *home_url);
1285
1286
1287 /**
1288  * @brief Sets the cellular pdn type.
1289  * @since_tizen 3.0
1290  * @param[in] profile         The profile handle
1291  * @param[in] type            The cellular pdn type
1292  * @return @c 0 on success,
1293  *         otherwise negative error value
1294  * @retval #CONNECTION_ERROR_NONE               Successful
1295  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
1296  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1297  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
1298  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1299 */
1300 int connection_profile_set_cellular_pdn_type(connection_profile_h profile,
1301                 connection_cellular_pdn_type_e type);
1302
1303
1304 /**
1305  * @brief Sets the cellular roam pdn type.
1306  * @since_tizen 3.0
1307  * @param[in] profile         The profile handle
1308  * @param[in] type            The cellular pdn type
1309  * @return @c 0 on success,
1310  *         otherwise negative error value
1311  * @retval #CONNECTION_ERROR_NONE               Successful
1312  * @retval #CONNECTION_ERROR_NOT_INITIALIZED    Not initialized
1313  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1314  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
1315  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1316 */
1317 int connection_profile_set_cellular_roam_pdn_type(connection_profile_h profile,
1318                 connection_cellular_pdn_type_e type);
1319
1320
1321 /**
1322 * @}
1323 */
1324
1325
1326 #ifdef __cplusplus
1327 }
1328
1329
1330 #endif
1331
1332
1333 #endif /* __TIZEN_NETWORK_CONNECTION_PROFILE_H__ */