Fixed typo
[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
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
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_INVALID_PARAMETER     Invalid parameter
253  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY         Out of memory
254  * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
255  * @retval #CONNECTION_ERROR_NOT_SUPPORTED         Not supported
256  * @see connection_profile_destroy()
257  * @see connection_profile_get_name()
258 */
259 int connection_profile_create(connection_profile_type_e type,
260                 const char *keyword, connection_profile_h *profile);
261
262
263 /**
264  * @brief Destroys a profile handle.
265  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
266  * @param[out] profile           The handle to the profile
267  * @return @c 0 on success,
268  *         otherwise a negative error value
269  * @retval #CONNECTION_ERROR_NONE                  Successful
270  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
271  * @see connection_profile_create()
272 */
273 int connection_profile_destroy(connection_profile_h profile);
274
275
276 /**
277  * @brief Clones a profile handle.
278  * @since_tizen 2.3
279  * @remarks You must release @a cloned_profile using connection_profile_destroy().
280  * @param[out] cloned_profile    The handle of the cloned profile
281  * @param[in] origin_profile     The handle of the origin profile
282  * @return @c 0 on success,
283  *         otherwise a negative error value
284  * @retval #CONNECTION_ERROR_NONE                  Successful
285  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
286  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY         Out of memory
287  * @see connection_profile_destroy()
288 */
289 int connection_profile_clone(connection_profile_h *cloned_profile,
290                 connection_profile_h origin_profile);
291
292
293 /**
294  * @brief Gets the profile ID.
295  * @details The separate profiles can have the same name.
296  *          So, you must use this API instead of connection_profile_get_name()
297  *          if you want to get the unique identification.
298  *          In case you create a profile, this value will be determined when you add the profile.
299  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
300  * @remarks You must release @a profile_id using free().
301  * @param[in] profile            The profile handle
302  * @param[out] profile_id        The ID of the profile
303  * @return @c 0 on success,
304  *         otherwise a negative error value
305  * @retval #CONNECTION_ERROR_NONE                  Successful
306  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
307  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY         Out of memory
308  * @see connection_profile_get_name()
309  * @see connection_add_profile()
310 */
311 int connection_profile_get_id(connection_profile_h profile, char **profile_id);
312
313
314 /**
315  * @brief Gets the profile name.
316  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
317  * @remarks You must release @a profile_name using free().
318  * @param[in] profile           The profile handle
319  * @param[out] profile_name     The name of the profile
320  * @return @c 0 on success,
321  *         otherwise a negative error value
322  * @retval #CONNECTION_ERROR_NONE                  Successful
323  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
324  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY         Out of memory
325  * @see connection_profile_get_id()
326 */
327 int connection_profile_get_name(connection_profile_h profile, char **profile_name);
328
329
330 /**
331  * @brief Gets the network type.
332  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
333  * @param[in] profile           The profile handle
334  * @param[out] type             The type of the profile
335  * @return @c 0 on success,
336  *         otherwise a negative error value
337  * @retval #CONNECTION_ERROR_NONE                  Successful
338  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
339  * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
340 */
341 int connection_profile_get_type(connection_profile_h profile, connection_profile_type_e *type);
342
343
344 /**
345  * @brief Gets the name of the network interface, e.g. eth0 and pdp0.
346  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
347  * @remarks You must release @a interface_name using free().
348  * @param[in] profile           The profile handle
349  * @param[out] interface_name   The name of the network interface
350  * @return @c 0 on success,
351  *         otherwise a negative error value
352  * @retval #CONNECTION_ERROR_NONE                  Successful
353  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
354  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY         Out of memory
355 */
356 int connection_profile_get_network_interface_name(connection_profile_h profile,
357                 char **interface_name);
358
359
360 /**
361  * @brief Refreshes the profile information.
362  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
363  * @privlevel public
364  * @privilege %http://tizen.org/privilege/network.get
365  * @remarks You should call this function in order to get the current information
366  *          because the profile information can be changed.
367  * @param[in] profile           The profile handle
368  * @return @c 0 on success,
369  *         otherwise a negative error value
370  * @retval #CONNECTION_ERROR_NONE                  Successful
371  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
372  * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
373  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY         Out of memory
374  * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
375 */
376 int connection_profile_refresh(connection_profile_h profile);
377
378
379 /**
380  * @brief Gets the network type.
381  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
382  * @param[in] profile           The profile handle
383  * @param[out] state            The state of the profile
384  * @return @c 0 on success,
385  *         otherwise a negative error value
386  * @retval #CONNECTION_ERROR_NONE                  Successful
387  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
388  * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
389 */
390 int connection_profile_get_state(connection_profile_h profile,
391                 connection_profile_state_e *state);
392
393
394 /**
395  * @brief Gets the IP config type.
396  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
397  * @param[in] profile           The profile handle
398  * @param[in] address_family    The address family
399  * @param[out] type             The type of the IP config
400  * @return @c 0 on success,
401  *         otherwise a negative error value
402  * @retval #CONNECTION_ERROR_NONE                  Successful
403  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
404  * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
405 */
406 int connection_profile_get_ip_config_type(connection_profile_h profile,
407                 connection_address_family_e address_family, connection_ip_config_type_e *type);
408
409
410 /**
411  * @brief Gets the IP address.
412  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
413  * @remarks You must release @a ip_address using free().
414  * @param[in] profile           The profile handle
415  * @param[in] address_family    The address family
416  * @param[out] ip_address       The IP address
417  * @return @c 0 on success,
418  *         otherwise a negative error value
419  * @retval #CONNECTION_ERROR_NONE                           Successful
420  * @retval #CONNECTION_ERROR_INVALID_PARAMETER              Invalid parameter
421  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY                  Out of memory
422  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
423  * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
424 */
425 int connection_profile_get_ip_address(connection_profile_h profile,
426                 connection_address_family_e address_family, char **ip_address);
427
428
429 /**
430  * @brief Gets the Subnet Mask.
431  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
432  * @remarks You must release @a subnet_mask using free().
433  *          This function is supported only for IPv4 address family.
434  * @param[in] profile           The profile handle
435  * @param[in] address_family    The address family
436  * @param[out] subnet_mask      The subnet mask
437  * @return @c 0 on success,
438  *         otherwise a negative error value
439  * @retval #CONNECTION_ERROR_NONE                           Successful
440  * @retval #CONNECTION_ERROR_INVALID_PARAMETER              Invalid parameter
441  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY                  Out of memory
442  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
443  * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
444 */
445 int connection_profile_get_subnet_mask(connection_profile_h profile,
446                 connection_address_family_e address_family, char **subnet_mask);
447
448
449 /**
450  * @brief Gets the Gateway address.
451  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
452  * @remarks You must release @a gateway_address using free().
453  * @param[in] profile           The profile handle
454  * @param[in] address_family    The address family
455  * @param[out] gateway_address  The gateway address
456  * @return @c 0 on success,
457  *         otherwise a negative error value
458  * @retval #CONNECTION_ERROR_NONE                           Successful
459  * @retval #CONNECTION_ERROR_INVALID_PARAMETER              Invalid parameter
460  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY                  Out of memory
461  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
462  * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
463 */
464 int connection_profile_get_gateway_address(connection_profile_h profile,
465                 connection_address_family_e address_family, char **gateway_address);
466
467 /**
468  * @brief Gets the DHCP Server address.
469  * @since_tizen 4.0
470  * @remarks You must release @a dhcp_server using free().
471  *          This function is supported only for IPv4 address family.
472  * @param[in] profile           The profile handle
473  * @param[in] address_family    The address family
474  * @param[out] dhcp_server      The DHCP Server address
475  * @return @c 0 on success, otherwise a negative error value
476  * @retval #CONNECTION_ERROR_NONE                           Successful
477  * @retval #CONNECTION_ERROR_INVALID_PARAMETER              Invalid parameter
478  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY                  Out of memory
479  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
480  * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
481 */
482 int connection_profile_get_dhcp_server_address(connection_profile_h profile,
483                 connection_address_family_e address_family, char **dhcp_server);
484
485 /**
486  * @brief Gets the DHCP lease duration.
487  * @since_tizen 4.0
488  * @param[in] profile                   The profile handle
489  * @param[in] address_family            The address family
490  * @param[out] dhcp_lease_duration      The DHCP lease duration in seconds
491  * @return @c 0 on success, otherwise a negative error value
492  * @retval #CONNECTION_ERROR_NONE                           Successful
493  * @retval #CONNECTION_ERROR_INVALID_PARAMETER              Invalid parameter
494  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
495  * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
496  * @retval #CONNECTION_ERROR_NOT_SUPPORTED                  Not supported
497 */
498 int connection_profile_get_dhcp_lease_duration(connection_profile_h profile,
499                 connection_address_family_e address_family, int *dhcp_lease_duration);
500
501 /**
502  * @brief Gets the DNS address.
503  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
504  * @remarks The allowance of the DNS address is @c 2. You must release @a dns_address using free().
505  * @param[in] profile           The profile handle
506  * @param[in] order             The order of DNS address \n
507  *            It starts from 1, which means first DNS address
508  * @param[in] address_family    The address family
509  * @param[out] dns_address      The DNS address
510  * @return @c 0 on success,
511  *         otherwise a negative error value
512  * @retval #CONNECTION_ERROR_NONE                           Successful
513  * @retval #CONNECTION_ERROR_INVALID_PARAMETER              Invalid parameter
514  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY                  Out of memory
515  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
516  * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
517 */
518 int connection_profile_get_dns_address(connection_profile_h profile,
519                 int order, connection_address_family_e address_family, char **dns_address);
520
521
522 /**
523  * @brief Gets the Proxy type.
524  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
525  * @param[in] profile           The profile handle
526  * @param[out] type             The type of the proxy
527  * @return @c 0 on success,
528  *         otherwise a negative error value
529  * @retval #CONNECTION_ERROR_NONE                  Successful
530  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
531  * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
532 */
533 int connection_profile_get_proxy_type(connection_profile_h profile,
534                 connection_proxy_type_e *type);
535
536
537 /**
538  * @brief Gets the Proxy address.
539  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
540  * @remarks You must release @a proxy_address using free().
541  * @param[in] profile           The profile handle
542  * @param[in] address_family    The address family
543  * @param[out] proxy_address    The proxy address
544  * @return @c 0 on success,
545  *         otherwise a negative error value
546  * @retval #CONNECTION_ERROR_NONE                           Successful
547  * @retval #CONNECTION_ERROR_INVALID_PARAMETER              Invalid parameter
548  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY                  Out of memory
549  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
550  * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
551 */
552 int connection_profile_get_proxy_address(connection_profile_h profile,
553                 connection_address_family_e address_family, char **proxy_address);
554
555
556 /**
557  * @brief Sets the IP config type.
558  * @details If you set IP config type to #CONNECTION_IP_CONFIG_TYPE_STATIC,
559  *          then IP address, Gateway and Subnet mask will be set to the initial value "0.0.0.0".
560  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
561  * @param[in] profile           The profile handle
562  * @param[in] address_family    The address family
563  * @param[in] type              The type of the IP config
564  * @return @c 0 on success,
565  *         otherwise a negative error value
566  * @retval #CONNECTION_ERROR_NONE                  Successful
567  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
568  * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
569 */
570 int connection_profile_set_ip_config_type(connection_profile_h profile,
571                 connection_address_family_e address_family, connection_ip_config_type_e type);
572
573
574 /**
575  * @brief Sets the IP address.
576  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
577  * @remarks You must release @a ip_address using free().
578  * @param[in] profile           The profile handle
579  * @param[in] address_family    The address family
580  * @param[in] ip_address        The IP address \n
581  *            If you set this value to @c NULL, then the existing value will be deleted
582  * @return @c 0 on success,
583  *         otherwise a negative error value
584  * @retval #CONNECTION_ERROR_NONE                           Successful
585  * @retval #CONNECTION_ERROR_INVALID_PARAMETER              Invalid parameter
586  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
587  * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
588  * @see connection_update_profile()
589 */
590 int connection_profile_set_ip_address(connection_profile_h profile,
591                 connection_address_family_e address_family, const char *ip_address);
592
593
594 /**
595  * @brief Sets the Subnet Mask.
596  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
597  * @remarks You must release @a subnet_mask using free().
598  *          This function is supported only for IPv4 address family.
599  * @param[in] profile           The profile handle
600  * @param[in] address_family    The address family
601  * @param[in] subnet_mask       The subnet mask \n
602  *            If you set this value to @c NULL, then the existing value will be deleted
603  * @return @c 0 on success,
604  *         otherwise a negative error value
605  * @retval #CONNECTION_ERROR_NONE                           Successful
606  * @retval #CONNECTION_ERROR_INVALID_PARAMETER              Invalid parameter
607  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
608  * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
609  * @see connection_update_profile()
610 */
611 int connection_profile_set_subnet_mask(connection_profile_h profile,
612                 connection_address_family_e address_family, const char *subnet_mask);
613
614
615 /**
616  * @brief Sets the Gateway address.
617  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
618  * @remarks You must release @a gateway_address using free().
619  * @param[in] profile           The profile handle
620  * @param[in] address_family    The address family
621  * @param[in] gateway_address   The gateway address \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_INVALID_PARAMETER              Invalid parameter
627  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
628  * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
629  * @see connection_update_profile()
630 */
631 int connection_profile_set_gateway_address(connection_profile_h profile,
632                 connection_address_family_e address_family, const char *gateway_address);
633
634
635 /**
636  * @brief Sets the DNS address.
637  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
638  * @remarks The allowance of the DNS address is @c 2.
639  * @remarks You must release @a dns_address using free().
640  * @param[in] profile           The profile handle
641  * @param[in] order             The order of the DNS address \n
642  *            It starts from @c 1, which means first DNS address
643  * @param[in] address_family    The address family
644  * @param[in] dns_address       The DNS address \n
645  *            If you set this value to NULL then the existing value will be deleted
646  * @return @c 0 on success,
647  *         otherwise a negative error value
648  * @retval #CONNECTION_ERROR_NONE                           Successful
649  * @retval #CONNECTION_ERROR_INVALID_PARAMETER              Invalid parameter
650  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
651  * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
652  * @see connection_update_profile()
653 */
654 int connection_profile_set_dns_address(connection_profile_h profile,
655                 int order, connection_address_family_e address_family, const char *dns_address);
656
657
658 /**
659  * @brief Sets the Proxy type.
660  * @details If you set the Proxy type to #CONNECTION_PROXY_TYPE_AUTO or
661  *          #CONNECTION_PROXY_TYPE_MANUAL, then Proxy will be restored.
662  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
663  * @param[in] profile           The profile handle
664  * @param[in] type              The type of the proxy
665  * @return @c 0 on success,
666  *         otherwise a negative error value
667  * @retval #CONNECTION_ERROR_NONE                  Successful
668  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
669  * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
670  * @see connection_update_profile()
671 */
672 int connection_profile_set_proxy_type(connection_profile_h profile,
673                 connection_proxy_type_e type);
674
675
676 /**
677  * @brief Sets the Proxy address.
678  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
679  * @remarks You must release @a proxy_address using free().
680  * @param[in] profile           The profile handle
681  * @param[in] address_family    The address family
682  * @param[in] proxy_address     The proxy address \n
683  *            If you set this value to @c NULL, then the existing value will be deleted
684  * @return @c 0 on success,
685  *         otherwise a negative error value
686  * @retval #CONNECTION_ERROR_NONE                           Successful
687  * @retval #CONNECTION_ERROR_INVALID_PARAMETER              Invalid parameter
688  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED   Not supported address family
689  * @retval #CONNECTION_ERROR_OPERATION_FAILED               Operation failed
690  * @see connection_update_profile()
691 */
692 int connection_profile_set_proxy_address(connection_profile_h profile,
693                 connection_address_family_e address_family, const char *proxy_address);
694
695
696 /**
697  * @brief Called when the state of the profile is changed.
698  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
699  * @param[in] state             The state
700  * @param[in] user_data         The user data passed from the callback registration function
701  * @see connection_profile_set_state_changed_cb()
702  * @see connection_profile_unset_state_changed_cb()
703 */
704 typedef void(*connection_profile_state_changed_cb)(connection_profile_state_e state,
705                 void *user_data);
706
707
708 /**
709  * @brief Registers the callback that is called when the state of profile is changed.
710  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
711  * @param[in] profile           The profile handle
712  * @param[in] callback          The callback function to be called
713  * @param[in] user_data         The user data passed to the callback function
714  * @return @c 0 on success,
715  *         otherwise a negative error value
716  * @retval #CONNECTION_ERROR_NONE                  Successful
717  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
718  * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
719  * @post connection_opened_cb() is invoked when the state of profile is changed.
720  * @see connection_profile_state_changed_cb()
721  * @see connection_profile_unset_state_changed_cb()
722 */
723 int connection_profile_set_state_changed_cb(connection_profile_h profile,
724                 connection_profile_state_changed_cb callback, void *user_data);
725
726
727 /**
728  * @brief Unregisters the callback that is called when the state of profile is changed.
729  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
730  * @param[in] profile           The profile handle
731  * @return @c 0 on success,
732  *         otherwise a negative error value
733  * @retval #CONNECTION_ERROR_NONE                  Successful
734  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
735  * @see connection_profile_state_changed_cb()
736  * @see connection_profile_set_state_changed_cb()
737 */
738 int connection_profile_unset_state_changed_cb(connection_profile_h profile);
739
740 /**
741  * @brief Gets the IPv6 network state.
742  * @since_tizen 4.0
743  * @param[in] profile           The profile handle
744  * @param[out] state            The profile state
745  * @return 0 on success, otherwise negative error value
746  * @retval #CONNECTION_ERROR_NONE                  Successful
747  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
748  * @retval #CONNECTION_ERROR_OPERATION_FAILED      Operation failed
749  * @retval #CONNECTION_ERROR_NOT_SUPPORTED         Not supported
750  */
751 int connection_profile_get_ipv6_state(connection_profile_h profile,
752                 connection_profile_state_e *state);
753
754 /**
755  * @brief Sets the DNS config type.
756  * @since_tizen 4.0
757  * @param[in] profile         The profile handle
758  * @param[in] address_family  The address family
759  * @param[in] type            The DNS config type
760  * @return 0 on success, otherwise negative error value
761  * @retval #CONNECTION_ERROR_NONE               Successful
762  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
763  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
764  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
765  */
766 int connection_profile_set_dns_config_type(connection_profile_h profile,
767                 connection_address_family_e address_family, connection_dns_config_type_e type);
768
769 /**
770  * @brief Gets the DNS config type.
771  * @since_tizen 4.0
772  * @param[in] profile         The profile handle
773  * @param[in] address_family  The address family
774  * @param[out] type           The DNS config type
775  * @return 0 on success, otherwise negative error value
776  * @retval #CONNECTION_ERROR_NONE               Successful
777  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
778  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
779  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
780  */
781 int connection_profile_get_dns_config_type(connection_profile_h profile,
782                 connection_address_family_e address_family, connection_dns_config_type_e *type);
783
784 /**
785  * @brief Gets the network prefix length.
786  * @since_tizen 4.0
787  * @param[in] profile         The profile handle
788  * @param[in] address_family  The address family
789  * @param[out] prefix_len     The network prefix length \n
790  *                            In case of IPv4, it means netmask length
791  *                            (also called a prefix, e.g. 8, 16, 24, 32)
792  * @return 0 on success, otherwise negative error value.
793  * @retval #CONNECTION_ERROR_NONE               Successful
794  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
795  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
796  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
797  */
798 int connection_profile_get_prefix_length(connection_profile_h profile,
799                 connection_address_family_e address_family, int *prefix_len);
800
801 /**
802  * @brief Sets the network prefix length.
803  * @since_tizen 4.0
804  * @param[in] profile         The profile handle
805  * @param[in] address_family  The address family
806  * @param[in] prefix_len      The network prefix length
807  *                            In case of IPv4, it means netmask length
808  *                            (also called a prefix, e.g. 8, 16, 24, 32)
809  * @return 0 on success, otherwise negative error value
810  * @retval #CONNECTION_ERROR_NONE               Successful
811  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
812  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
813  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
814  * @see connection_update_profile()
815  */
816 int connection_profile_set_prefix_length(connection_profile_h profile,
817                 connection_address_family_e address_family, int prefix_len);
818
819 /**
820 * @}
821 */
822
823
824 /**
825 * @addtogroup CAPI_NETWORK_CONNECTION_WIFI_PROFILE_MODULE
826 * @{
827 */
828
829
830 /**
831  * @brief Gets the ESSID (Extended Service Set Identifier).
832  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
833  * @remarks You must release @a essid using free().
834  * @param[in] profile         The profile handle
835  * @param[out] essid          The ESSID
836  * @return @c 0 on success,
837  *         otherwise a negative error value
838  * @retval #CONNECTION_ERROR_NONE               Successful
839  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
840  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY      Out of memory
841  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
842 */
843 int connection_profile_get_wifi_essid(connection_profile_h profile, char **essid);
844
845
846 /**
847  * @brief Gets the BSSID (Basic Service Set Identifier).
848  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
849  * @remarks You must release @a bssid using free().
850  * @param[in] profile         The profile handle
851  * @param[out] bssid          The BSSID
852  * @return @c 0 on success,
853  *         otherwise a negative error value
854  * @retval #CONNECTION_ERROR_NONE               Successful
855  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
856  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY      Out of memory
857  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
858 */
859 int connection_profile_get_wifi_bssid(connection_profile_h profile, char **bssid);
860
861
862 /**
863  * @brief Gets the RSSI.
864  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
865  * @param[in] profile         The profile handle
866  * @param[out] rssi           The RSSI
867  * @return @c 0 on success,
868  *         otherwise a negative error value
869  * @retval #CONNECTION_ERROR_NONE               Successful
870  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
871  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
872 */
873 int connection_profile_get_wifi_rssi(connection_profile_h profile, int *rssi);
874
875
876 /**
877  * @brief Gets the frequency (MHz).
878  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
879  * @param[in] profile         The profile handle
880  * @param[out] frequency      The frequency
881  * @return @c 0 on success,
882  *         otherwise a negative error value
883  * @retval #CONNECTION_ERROR_NONE               Successful
884  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
885  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
886 */
887 int connection_profile_get_wifi_frequency(connection_profile_h profile, int *frequency);
888
889
890 /**
891  * @brief Gets the max speed (Mbps).
892  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
893  * @param[in] profile         The profile handle
894  * @param[out] max_speed      The max speed
895  * @return @c 0 on success,
896  *         otherwise a negative error value
897  * @retval #CONNECTION_ERROR_NONE               Successful
898  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
899  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
900 */
901 int connection_profile_get_wifi_max_speed(connection_profile_h profile, int *max_speed);
902
903
904 /**
905  * @brief Gets the security mode of Wi-Fi.
906  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
907  * @param[in] profile         The profile handle
908  * @param[out] type           The type of Wi-Fi security
909  * @return @c 0 on success,
910  *         otherwise a negative error value
911  * @retval #CONNECTION_ERROR_NONE               Successful
912  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
913  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
914  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
915 */
916 int connection_profile_get_wifi_security_type(connection_profile_h profile,
917                 connection_wifi_security_type_e *type);
918
919
920 /**
921  * @brief Gets the security mode of Wi-Fi.
922  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
923  * @param[in] profile         The profile handle
924  * @param[out] type           The type of Wi-Fi security
925  * @return @c 0 on success,
926  *         otherwise a negative error value
927  * @retval #CONNECTION_ERROR_NONE               Successful
928  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
929  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
930  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
931 */
932 int connection_profile_get_wifi_encryption_type(connection_profile_h profile,
933                 connection_wifi_encryption_type_e *type);
934
935
936 /**
937  * @brief Checks whether passphrase is required.
938  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
939  * @remarks This function is not valid if security type is #CONNECTION_WIFI_SECURITY_TYPE_EAP.
940  * @param[in] profile         The profile handle
941  * @param[out] required       @c true if a passphrase is required,
942  *                            otherwise @c false if a passphrase is not required
943  * @return @c 0 on success,
944  *         otherwise a negative error value
945  * @retval #CONNECTION_ERROR_NONE Successful
946  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
947  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
948 */
949 int connection_profile_is_wifi_passphrase_required(connection_profile_h profile,
950                 bool *required);
951
952
953 /**
954  * @brief Sets the passphrase of the Wi-Fi WPA.
955  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
956  * @remarks You must release @a passphrase using free().
957  * @param[in] profile         The profile handle
958  * @param[in] passphrase      The passphrase of Wi-Fi security
959  * @return @c 0 on success,
960  *         otherwise a negative error value
961  * @retval #CONNECTION_ERROR_NONE               Successful
962  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
963  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
964  * @see connection_update_profile()
965 */
966 int connection_profile_set_wifi_passphrase(connection_profile_h profile,
967                 const char *passphrase);
968
969
970 /**
971  * @brief Checks whether the WPS (Wi-Fi Protected Setup) is supported.
972  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
973  * @remarks If WPS is supported, you can connect the access point with WPS by wifi_connect_with_wps().
974  * @param[in] profile         The profile handle
975  * @param[out] supported      @c true if WPS is supported,
976  *                            otherwise @c false if WPS is not supported
977  * @return @c 0 on success,
978  *         otherwise negative error value
979  * @retval #CONNECTION_ERROR_NONE               Successful
980  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
981  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
982 */
983 int connection_profile_is_wifi_wps_supported(connection_profile_h profile,
984                 bool *supported);
985
986
987 /**
988 * @}
989 */
990
991
992 /**
993 * @addtogroup CAPI_NETWORK_CONNECTION_CELLULAR_PROFILE_MODULE
994 * @{
995 */
996
997
998 /**
999  * @brief Gets the service type.
1000  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1001  * @param[in] profile         The profile handle
1002  * @param[out] type           The type of the cellular service
1003  * @return @c 0 on success,
1004  *         otherwise a negative error value
1005  * @retval #CONNECTION_ERROR_NONE               Successful
1006  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1007  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
1008  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1009 */
1010 int connection_profile_get_cellular_service_type(connection_profile_h profile,
1011                 connection_cellular_service_type_e *type);
1012
1013
1014 /**
1015  * @brief Gets the APN (access point name).
1016  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1017  * @remarks You must release @a apn using free().
1018  * @param[in] profile         The profile handle
1019  * @param[out] apn            The name of the APN
1020  * @return @c 0 on success,
1021  *         otherwise a negative error value
1022  * @retval #CONNECTION_ERROR_NONE               Successful
1023  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1024  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY      Out of memory
1025  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1026 */
1027 int connection_profile_get_cellular_apn(connection_profile_h profile, char **apn);
1028
1029
1030 /**
1031  * @brief Gets the authentication information.
1032  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1033  * @remarks You must release @a user_name and @a password using free().
1034  * @param[in] profile         The profile handle
1035  * @param[out] type           The type of the authentication
1036  * @param[out] user_name      The user name
1037  * @param[out] password       The password
1038  * @return @c 0 on success,
1039  *         otherwise a negative error value
1040  * @retval #CONNECTION_ERROR_NONE               Successful
1041  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1042  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY      Out of memory
1043  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
1044  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1045 */
1046 int connection_profile_get_cellular_auth_info(connection_profile_h profile,
1047                 connection_cellular_auth_type_e *type, char **user_name, char **password);
1048
1049
1050 /**
1051  * @brief Gets the home URL.
1052  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1053  * @remarks You must release @a home_url using free().
1054  * @param[in] profile         The profile handle
1055  * @param[out] home_url       The home URL
1056  * @return @c 0 on success,
1057  *         otherwise a negative error value
1058  * @retval #CONNECTION_ERROR_NONE               Successful
1059  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1060  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY      Out of memory
1061  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1062 */
1063 int connection_profile_get_cellular_home_url(connection_profile_h profile,
1064                 char **home_url);
1065
1066
1067 /**
1068  * @brief Gets the cellular pdn type.
1069  * @since_tizen 3.0
1070  * @param[in] profile         The profile handle
1071  * @param[out] type           The cellular pdn type
1072  * @return @c 0 on success,
1073  *         otherwise negative error value
1074  * @retval #CONNECTION_ERROR_NONE               Successful
1075  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1076  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
1077  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1078 */
1079 int connection_profile_get_cellular_pdn_type(connection_profile_h profile,
1080                 connection_cellular_pdn_type_e *type);
1081
1082
1083 /**
1084  * @brief Gets the cellular roam pdn type.
1085  * @since_tizen 3.0
1086  * @param[in] profile         The profile handle
1087  * @param[out] type           The cellular pdn type
1088  * @return @c 0 on success,
1089  *         otherwise negative error value
1090  * @retval #CONNECTION_ERROR_NONE               Successful
1091  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1092  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
1093  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1094 */
1095 int connection_profile_get_cellular_roam_pdn_type(connection_profile_h profile,
1096                 connection_cellular_pdn_type_e *type);
1097
1098
1099 /**
1100  * @brief Checks whether the connection is in roaming state.
1101  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1102  * @param[in] profile         The profile handle
1103  * @param[out] is_roaming     @c true if the cellular is roaming,
1104  *                            otherwise @c false if it is not roaming
1105  * @return @c 0 on success,
1106  *         otherwise a negative error value
1107  * @retval #CONNECTION_ERROR_NONE               Successful
1108  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1109  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1110 */
1111 int connection_profile_is_cellular_roaming(connection_profile_h profile,
1112                 bool *is_roaming);
1113
1114
1115 /**
1116  * @brief Checks whether the profile is hidden.
1117  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1118  * @param[in] profile         The profile handle
1119  * @param[out] is_hidden      @c true if the profile is in hidden,
1120  *                            otherwise @c false if the profile is not hidden
1121  * @return @c 0 on success,
1122  *         otherwise a negative error value
1123  * @retval #CONNECTION_ERROR_NONE               Successful
1124  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1125  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1126 */
1127 int connection_profile_is_cellular_hidden(connection_profile_h profile,
1128                 bool *is_hidden);
1129
1130
1131 /**
1132  * @brief Checks whether the profile is editable.
1133  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1134  * @param[in] profile         The profile handle
1135  * @param[out] is_editable    @c true if the profile is editable,
1136  *                            otherwise @c false if the profile is not editable
1137  * @return @c 0 on success,
1138  *         otherwise a negative error value
1139  * @retval #CONNECTION_ERROR_NONE               Successful
1140  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1141  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1142 */
1143 int connection_profile_is_cellular_editable(connection_profile_h profile,
1144                 bool *is_editable);
1145
1146
1147 /**
1148  * @brief Checks whether the profile is default.
1149  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1150  * @param[in] profile         The profile handle
1151  * @param[out] is_default     @c true if the profile is default,
1152  *                            otherwise @c false if the profile is not default
1153  * @return @c 0 on success,
1154  *         otherwise a negative error value
1155  * @retval #CONNECTION_ERROR_NONE               Successful
1156  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1157  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1158 */
1159 int connection_profile_is_cellular_default(connection_profile_h profile,
1160                 bool *is_default);
1161
1162
1163 /**
1164  * @brief Sets the service type.
1165  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1166  * @param[in] profile         The profile handle
1167  * @param[in] service_type    The type of cellular service
1168  * @return @c 0 on success,
1169  *         otherwise a negative error value
1170  * @retval #CONNECTION_ERROR_NONE               Successful
1171  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1172  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1173  * @see connection_update_profile()
1174 */
1175 int connection_profile_set_cellular_service_type(connection_profile_h profile,
1176                 connection_cellular_service_type_e service_type);
1177
1178
1179 /**
1180  * @brief Sets the APN (Access Point Name).
1181  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1182  * @remarks You must release @a apn using free().
1183  * @param[in] profile         The profile handle
1184  * @param[in] apn             The name of APN
1185  * @return @c 0 on success,
1186  *         otherwise a negative error value
1187  * @retval #CONNECTION_ERROR_NONE               Successful
1188  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1189  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1190  * @see connection_update_profile()
1191 */
1192 int connection_profile_set_cellular_apn(connection_profile_h profile, const char *apn);
1193
1194
1195 /**
1196  * @brief Sets the Authentication information.
1197  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1198  * @remarks You must release @a user_name using free().
1199  * @param[in] profile         The profile handle
1200  * @param[in] type            The type of the authentication
1201  * @param[in] user_name       The user name
1202  * @param[in] password        The password
1203  * @return @c 0 on success,
1204  *         otherwise a negative error value
1205  * @retval #CONNECTION_ERROR_NONE               Successful
1206  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1207  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1208  * @see connection_update_profile()
1209 */
1210 int connection_profile_set_cellular_auth_info(connection_profile_h profile,
1211                 connection_cellular_auth_type_e type, const char *user_name, const char *password);
1212
1213
1214 /**
1215  * @brief Sets the home URL.
1216  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1217  * @remarks You must release @a home_url using free().
1218  * @param[in] profile         The profile handle
1219  * @param[in] home_url        The home URL
1220  * @return @c 0 on success,
1221  *         otherwise a negative error value
1222  * @retval #CONNECTION_ERROR_NONE               Successful
1223  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1224  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1225  * @see connection_update_profile()
1226 */
1227 int connection_profile_set_cellular_home_url(connection_profile_h profile,
1228                 const char *home_url);
1229
1230
1231 /**
1232  * @brief Sets the cellular pdn type.
1233  * @since_tizen 3.0
1234  * @param[in] profile         The profile handle
1235  * @param[in] type            The cellular pdn type
1236  * @return @c 0 on success,
1237  *         otherwise negative error value
1238  * @retval #CONNECTION_ERROR_NONE               Successful
1239  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1240  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
1241  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1242 */
1243 int connection_profile_set_cellular_pdn_type(connection_profile_h profile,
1244                 connection_cellular_pdn_type_e type);
1245
1246
1247 /**
1248  * @brief Sets the cellular roam pdn type.
1249  * @since_tizen 3.0
1250  * @param[in] profile         The profile handle
1251  * @param[in] type            The cellular pdn type
1252  * @return @c 0 on success,
1253  *         otherwise negative error value
1254  * @retval #CONNECTION_ERROR_NONE               Successful
1255  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
1256  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
1257  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
1258 */
1259 int connection_profile_set_cellular_roam_pdn_type(connection_profile_h profile,
1260                 connection_cellular_pdn_type_e type);
1261
1262
1263 /**
1264 * @}
1265 */
1266
1267
1268 #ifdef __cplusplus
1269 }
1270
1271
1272 #endif
1273
1274
1275 #endif /* __TIZEN_NETWORK_CONNECTION_PROFILE_H__ */