Add new APIs for IPv6 and DNS configuration
[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  */
97 typedef enum {
98         CONNECTION_CELLULAR_PDN_TYPE_UNKNOWN = 0,
99         CONNECTION_CELLULAR_PDN_TYPE_IPV4 = 1,
100         CONNECTION_CELLULAR_PDN_TYPE_IPV6 = 2,
101         CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPv6 = 3,
102 } connection_cellular_pdn_type_e;
103
104
105 /**
106  * @brief Enumeration for cellular authentication type.
107  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
108 */
109 typedef enum {
110         CONNECTION_CELLULAR_AUTH_TYPE_NONE = 0, /**< No authentication */
111         CONNECTION_CELLULAR_AUTH_TYPE_PAP  = 1, /**< PAP authentication */
112         CONNECTION_CELLULAR_AUTH_TYPE_CHAP = 2, /**< CHAP authentication */
113 } connection_cellular_auth_type_e;
114
115
116 /**
117 * @}
118 */
119
120
121 /**
122 * @addtogroup CAPI_NETWORK_CONNECTION_PROFILE_MODULE
123 * @{
124 */
125
126
127 /**
128  * @brief The profile handle.
129  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
130 */
131 typedef void* connection_profile_h;
132
133
134 /**
135  * @brief Enumeration for profile state type.
136  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
137 */
138 typedef enum {
139         CONNECTION_PROFILE_STATE_DISCONNECTED = 0, /**< Disconnected state */
140         CONNECTION_PROFILE_STATE_ASSOCIATION = 1, /**< Association state */
141         CONNECTION_PROFILE_STATE_CONFIGURATION = 2, /**< Configuration state */
142         CONNECTION_PROFILE_STATE_CONNECTED = 3, /**< Connected state */
143 } connection_profile_state_e;
144
145
146 /**
147  * @brief Enumeration for address family.
148  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
149 */
150 typedef enum {
151         CONNECTION_ADDRESS_FAMILY_IPV4 = 0, /**< IPV4 Address type */
152         CONNECTION_ADDRESS_FAMILY_IPV6 = 1, /**< IPV6 Address type */
153 } connection_address_family_e;
154
155
156 /**
157  * @brief Enumeration for IP configuration type.
158  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
159 */
160 typedef enum {
161         CONNECTION_IP_CONFIG_TYPE_NONE = 0, /**< Not defined */
162         CONNECTION_IP_CONFIG_TYPE_STATIC  = 1, /**< Manual IP configuration */
163         CONNECTION_IP_CONFIG_TYPE_DYNAMIC = 2, /**< Config IP using DHCP client*/
164         CONNECTION_IP_CONFIG_TYPE_AUTO = 3, /**< Config IP from Auto IP pool (169.254/16). Later with DHCP client, if available */
165         CONNECTION_IP_CONFIG_TYPE_FIXED = 4, /**< Indicates an IP address that can not be modified */
166 } connection_ip_config_type_e;
167
168
169 /**
170  * @brief Enumeration for proxy method type.
171  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
172 */
173 typedef enum {
174         CONNECTION_PROXY_TYPE_DIRECT = 0, /**< Direct connection */
175         CONNECTION_PROXY_TYPE_AUTO = 1, /**< Auto configuration(Use PAC file). If URL property is not set, DHCP/WPAD auto-discover will be tried */
176         CONNECTION_PROXY_TYPE_MANUAL  = 2, /**< Manual configuration */
177 } connection_proxy_type_e;
178
179 /**
180  * @brief Enumeration for DNS configuration type.
181  * @since_tizen 4.0
182  */
183 typedef enum
184 {
185         CONNECTION_DNS_CONFIG_TYPE_NONE = 0,     /**< Not defined */
186         CONNECTION_DNS_CONFIG_TYPE_STATIC = 1,   /**< Manual DNS configuration */
187         CONNECTION_DNS_CONFIG_TYPE_DYNAMIC = 2,  /**< Config DNS using DHCP client*/
188 } connection_dns_config_type_e;
189
190 /**
191  * @brief Enumeration for network connection type.
192  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
193 */
194 typedef enum {
195         CONNECTION_PROFILE_TYPE_CELLULAR = 0, /**< Cellular type */
196         CONNECTION_PROFILE_TYPE_WIFI = 1, /**< Wi-Fi type */
197         CONNECTION_PROFILE_TYPE_ETHERNET = 2, /**< Ethernet type */
198         CONNECTION_PROFILE_TYPE_BT = 3, /**< Bluetooth type */
199 } connection_profile_type_e;
200
201
202 /**
203  * @brief Creates a profile handle.
204  * @details The profile name, which you get from connection_profile_get_name(), will include the keyword you set.
205  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
206  * @privlevel public
207  * @privilege %http://tizen.org/privilege/network.get
208  * @remarks You must release @a profile using connection_profile_destroy().
209  * @param[in] type The type of profile \n
210  *                         #CONNECTION_PROFILE_TYPE_CELLULAR and #CONNECTION_PROFILE_TYPE_WIFI are supported
211  * @param[in] keyword The keyword included in profile name
212  * @param[out] profile The handle of the profile
213  * @return @c 0 on success,
214  *         otherwise negative error value
215  * @retval #CONNECTION_ERROR_NONE Successful
216  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
217  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
218  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
219  * @see connection_profile_destroy()
220  * @see connection_profile_get_name()
221 */
222 int connection_profile_create(connection_profile_type_e type, const char* keyword, connection_profile_h* profile);
223
224
225 /**
226  * @brief Destroys a profile handle.
227  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
228  * @param[out] profile The handle to the profile
229  * @return @c 0 on success,
230  *         otherwise a negative error value
231  * @retval #CONNECTION_ERROR_NONE Successful
232  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
233  * @see connection_profile_create()
234 */
235 int connection_profile_destroy(connection_profile_h profile);
236
237
238 /**
239  * @brief Clones a profile handle.
240  * @since_tizen 2.3
241  * @remarks You must release @a cloned_profile using connection_profile_destroy().
242  * @param[out] cloned_profile The handle of the cloned profile
243  * @param[in] origin_profile The handle of the origin profile
244  * @return @c 0 on success,
245  *         otherwise a negative error value
246  * @retval #CONNECTION_ERROR_NONE Successful
247  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
248  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
249  * @see connection_profile_destroy()
250 */
251 int connection_profile_clone(connection_profile_h* cloned_profile, connection_profile_h origin_profile);
252
253
254 /**
255  * @brief Gets the profile ID.
256  * @details The separate profiles can have the same name.
257  *          So, you must use this API instead of connection_profile_get_name() if you want to get the unique identification.
258  *          In case you create a profile, this value will be determined when you add the profile.
259  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
260  * @remarks You must release @a profile_id using free().
261  * @param[in] profile The profile handle
262  * @param[out] profile_id The ID of the profile
263  * @return @c 0 on success,
264  *         otherwise a negative error value
265  * @retval #CONNECTION_ERROR_NONE Successful
266  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
267  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
268  * @see connection_profile_get_name()
269  * @see connection_add_profile()
270 */
271 int connection_profile_get_id(connection_profile_h profile, char** profile_id);
272
273
274 /**
275  * @brief Gets the profile name.
276  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
277  * @remarks You must release @a profile_name using free().
278  * @param[in] profile The profile handle
279  * @param[out] profile_name The name of the profile
280  * @return @c 0 on success,
281  *         otherwise a negative error value
282  * @retval #CONNECTION_ERROR_NONE Successful
283  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
284  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
285  * @see connection_profile_get_id()
286 */
287 int connection_profile_get_name(connection_profile_h profile, char** profile_name);
288
289
290 /**
291  * @brief Gets the network type.
292  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
293  * @param[in] profile The profile handle
294  * @param[out] type The type of the profile
295  * @return @c 0 on success,
296  *         otherwise a negative error value
297  * @retval #CONNECTION_ERROR_NONE Successful
298  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
299  * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
300 */
301 int connection_profile_get_type(connection_profile_h profile, connection_profile_type_e* type);
302
303
304 /**
305  * @brief Gets the name of the network interface, e.g. eth0 and pdp0.
306  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
307  * @remarks You must release @a interface_name using free().
308  * @param[in] profile The profile handle
309  * @param[out] interface_name The name of the network interface
310  * @return @c 0 on success,
311  *         otherwise a negative error value
312  * @retval #CONNECTION_ERROR_NONE Successful
313  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
314  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
315 */
316 int connection_profile_get_network_interface_name(connection_profile_h profile, char** interface_name);
317
318
319 /**
320  * @brief Refreshes the profile information.
321  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
322  * @privlevel public
323  * @privilege %http://tizen.org/privilege/network.get
324  * @remarks You should call this function in order to get the current information because the profile information can be changed.
325  * @param[in] profile The profile handle
326  * @return @c 0 on success,
327  *         otherwise a negative error value
328  * @retval #CONNECTION_ERROR_NONE Successful
329  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
330  * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
331  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
332  * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
333 */
334 int connection_profile_refresh(connection_profile_h profile);
335
336
337 /**
338  * @brief Gets the network type.
339  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
340  * @param[in] profile The profile handle
341  * @param[out] state The state of the profile
342  * @return @c 0 on success,
343  *         otherwise a negative error value
344  * @retval #CONNECTION_ERROR_NONE Successful
345  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
346  * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
347 */
348 int connection_profile_get_state(connection_profile_h profile, connection_profile_state_e* state);
349
350
351 /**
352  * @brief Gets the IP config type.
353  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
354  * @param[in] profile The profile handle
355  * @param[in] address_family The address family
356  * @param[out] type The type of the IP config
357  * @return @c 0 on success,
358  *         otherwise a negative error value
359  * @retval #CONNECTION_ERROR_NONE Successful
360  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
361  * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
362 */
363 int connection_profile_get_ip_config_type(connection_profile_h profile, connection_address_family_e address_family, connection_ip_config_type_e* type);
364
365
366 /**
367  * @brief Gets the IP address.
368  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
369  * @remarks You must release @a ip_address using free().
370  * @param[in] profile The profile handle
371  * @param[in] address_family The address family
372  * @param[out] ip_address The IP address
373  * @return @c 0 on success,
374  *         otherwise a negative error value
375  * @retval #CONNECTION_ERROR_NONE Successful
376  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
377  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
378  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
379  * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
380 */
381 int connection_profile_get_ip_address(connection_profile_h profile, connection_address_family_e address_family, char** ip_address);
382
383
384 /**
385  * @brief Gets the Subnet Mask.
386  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
387  * @remarks You must release @a subnet_mask using free().
388  * @param[in] profile The profile handle
389  * @param[in] address_family The address family
390  * @param[out] subnet_mask The subnet mask
391  * @return @c 0 on success,
392  *         otherwise a negative error value
393  * @retval #CONNECTION_ERROR_NONE Successful
394  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
395  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
396  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
397  * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
398 */
399 int connection_profile_get_subnet_mask(connection_profile_h profile, connection_address_family_e address_family, char** subnet_mask);
400
401
402 /**
403  * @brief Gets the Gateway address.
404  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
405  * @remarks You must release @a gateway_address using free().
406  * @param[in] profile The profile handle
407  * @param[in] address_family The address family
408  * @param[out] gateway_address The gateway address
409  * @return @c 0 on success,
410  *         otherwise a negative error value
411  * @retval #CONNECTION_ERROR_NONE Successful
412  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
413  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
414  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
415  * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
416 */
417 int connection_profile_get_gateway_address(connection_profile_h profile, connection_address_family_e address_family, char** gateway_address);
418
419
420 /**
421  * @brief Gets the DNS address.
422  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
423  * @remarks The allowance of the DNS address is @c 2. You must release @a dns_address using free().
424  * @param[in] profile The profile handle
425  * @param[in] order The order of DNS address \n
426  *                          it starts from 1, which means first DNS address
427  * @param[in] address_family The address family
428  * @param[out] dns_address The DNS address
429  * @return @c 0 on success,
430  *         otherwise a negative error value
431  * @retval #CONNECTION_ERROR_NONE Successful
432  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
433  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
434  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
435  * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
436 */
437 int connection_profile_get_dns_address(connection_profile_h profile, int order, connection_address_family_e address_family, char** dns_address);
438
439
440 /**
441  * @brief Gets the Proxy type.
442  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
443  * @param[in] profile The profile handle
444  * @param[out] type The type of the proxy
445  * @return @c 0 on success,
446  *         otherwise a negative error value
447  * @retval #CONNECTION_ERROR_NONE Successful
448  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
449  * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
450 */
451 int connection_profile_get_proxy_type(connection_profile_h profile, connection_proxy_type_e* type);
452
453
454 /**
455  * @brief Gets the Proxy address.
456  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
457  * @remarks You must release @a proxy_address using free().
458  * @param[in] profile The profile handle
459  * @param[in] address_family The address family
460  * @param[out] proxy_address The proxy address
461  * @return @c 0 on success,
462  *         otherwise a negative error value
463  * @retval #CONNECTION_ERROR_NONE Successful
464  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
465  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
466  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
467  * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
468 */
469 int connection_profile_get_proxy_address(connection_profile_h profile, connection_address_family_e address_family, char** proxy_address);
470
471
472 /**
473  * @brief Sets the IP config type.
474  * @details If you set IP config type to #CONNECTION_IP_CONFIG_TYPE_STATIC,
475  *          then IP address, Gateway and Subnet mask will be set to the initial value "0.0.0.0".
476  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
477  * @param[in] profile The profile handle
478  * @param[in] address_family The address family
479  * @param[in] type The type of the IP config
480  * @return @c 0 on success,
481  *         otherwise a negative error value
482  * @retval #CONNECTION_ERROR_NONE Successful
483  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
484  * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
485 */
486 int connection_profile_set_ip_config_type(connection_profile_h profile, connection_address_family_e address_family, connection_ip_config_type_e type);
487
488
489 /**
490  * @brief Sets the IP address.
491  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
492  * @param[in] profile The profile handle
493  * @param[in] address_family The address family
494  * @param[in] ip_address The IP address. \n
495  *                                   If you set this value to @c NULL, then the existing value will be deleted
496  * @return @c 0 on success,
497  *         otherwise a negative error value
498  * @retval #CONNECTION_ERROR_NONE Successful
499  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
500  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED  Not supported address family
501  * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
502  * @see connection_update_profile()
503 */
504 int connection_profile_set_ip_address(connection_profile_h profile, connection_address_family_e address_family, const char* ip_address);
505
506
507 /**
508  * @brief Sets the Subnet Mask.
509  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
510  * @param[in] profile The profile handle
511  * @param[in] address_family The address family
512  * @param[in] subnet_mask The subnet mask. \n
513  *                                    If you set this value to @c NULL, then the existing value will be deleted
514  * @return @c 0 on success,
515  *         otherwise a negative error value
516  * @retval #CONNECTION_ERROR_NONE Successful
517  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
518  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
519  * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
520  * @see connection_update_profile()
521 */
522 int connection_profile_set_subnet_mask(connection_profile_h profile, connection_address_family_e address_family, const char* subnet_mask);
523
524
525 /**
526  * @brief Sets the Gateway address.
527  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
528  * @param[in] profile The profile handle
529  * @param[in] address_family The address family
530  * @param[in] gateway_address The gateway address. \n
531  *                                        If you set this value to @c NULL, then the existing value will be deleted
532  * @return @c 0 on success,
533  *         otherwise a negative error value
534  * @retval #CONNECTION_ERROR_NONE Successful
535  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
536  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
537  * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
538  * @see connection_update_profile()
539 */
540 int connection_profile_set_gateway_address(connection_profile_h profile, connection_address_family_e address_family, const char* gateway_address);
541
542
543 /**
544  * @brief Sets the DNS address.
545  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
546  * @remarks The allowance of the DNS address is @c 2.
547  * @param[in] profile The profile handle
548  * @param[in] order The order of the DNS address. \n
549  *                          It starts from @c 1, which means first DNS address
550  * @param[in] address_family The address family
551  * @param[in] dns_address The DNS address; if you set this value to NULL, then the existing value will be deleted
552  * @return @c 0 on success,
553  *         otherwise a negative error value
554  * @retval #CONNECTION_ERROR_NONE Successful
555  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
556  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
557  * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
558  * @see connection_update_profile()
559 */
560 int connection_profile_set_dns_address(connection_profile_h profile, int order, connection_address_family_e address_family, const char* dns_address);
561
562
563 /**
564  * @brief Sets the Proxy type.
565  * @details If you set the Proxy type to #CONNECTION_PROXY_TYPE_AUTO or #CONNECTION_PROXY_TYPE_MANUAL, then Proxy will be restored.
566  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
567  * @param[in] profile The profile handle
568  * @param[in] type The type of the proxy
569  * @return @c 0 on success,
570  *         otherwise a negative error value
571  * @retval #CONNECTION_ERROR_NONE Successful
572  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
573  * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
574  * @see connection_update_profile()
575 */
576 int connection_profile_set_proxy_type(connection_profile_h profile, connection_proxy_type_e type);
577
578
579 /**
580  * @brief Sets the Proxy address.
581  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
582  * @param[in] profile The profile handle
583  * @param[in] address_family The address family
584  * @param[in] proxy_address The proxy address. \n
585  *                                      If you set this value to @c NULL, then the existing value will be deleted
586  * @return @c 0 on success,
587  *         otherwise a negative error value
588  * @retval #CONNECTION_ERROR_NONE Successful
589  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
590  * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
591  * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
592  * @see connection_update_profile()
593 */
594 int connection_profile_set_proxy_address(connection_profile_h profile, connection_address_family_e address_family, const char* proxy_address);
595
596
597 /**
598  * @brief Called when the state of the profile is changed.
599  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
600  * @param[in] state The state
601  * @param[in] user_data The user data passed from the callback registration function
602  * @see connection_profile_set_state_changed_cb()
603  * @see connection_profile_unset_state_changed_cb()
604 */
605 typedef void(*connection_profile_state_changed_cb)(connection_profile_state_e state, void* user_data);
606
607
608 /**
609  * @brief Registers the callback that is called when the state of profile is changed.
610  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
611  * @param[in] profile The profile handle
612  * @param[in] callback The callback function to be called
613  * @param[in] user_data The user data passed to the callback function
614  * @return @c 0 on success,
615  *         otherwise a negative error value
616  * @retval #CONNECTION_ERROR_NONE Successful
617  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
618  * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
619  * @post connection_opened_cb() is invoked when the state of profile is changed.
620  * @see connection_profile_state_changed_cb()
621  * @see connection_profile_unset_state_changed_cb()
622 */
623 int connection_profile_set_state_changed_cb(connection_profile_h profile, connection_profile_state_changed_cb callback, void* user_data);
624
625
626 /**
627  * @brief Unregisters the callback that is called when the state of profile is changed.
628  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
629  * @param[in] profile The profile handle
630  * @return @c 0 on success,
631  *         otherwise a negative error value
632  * @retval #CONNECTION_ERROR_NONE Successful
633  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
634  * @see connection_profile_state_changed_cb()
635  * @see connection_profile_set_state_changed_cb()
636 */
637 int connection_profile_unset_state_changed_cb(connection_profile_h profile);
638
639 /**
640  * @brief Gets the IPv6 network state.
641  * @since_tizen 4.0
642  * @param[in] profile The profile handle
643  * @param[out] state  The profile state
644  * @return 0 on success, otherwise negative error value.
645  * @retval #CONNECTION_ERROR_NONE               Successful
646  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
647  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
648  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
649  */
650 int connection_profile_get_ipv6_state(connection_profile_h profile, connection_profile_state_e *state);
651
652 /**
653  * @brief Sets the DNS config type.
654  * @since_tizen 4.0
655  * @param[in] profile         The profile handle
656  * @param[in] address_family  The address family
657  * @param[in] type            The DNS config type
658  * @return 0 on success, otherwise negative error value.
659  * @retval #CONNECTION_ERROR_NONE               Successful
660  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
661  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
662  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
663  */
664 int connection_profile_set_dns_config_type(connection_profile_h profile,
665                 connection_address_family_e address_family, connection_dns_config_type_e type);
666
667 /**
668  * @brief Gets the DNS config type.
669  * @since_tizen 4.0
670  * @param[in] profile         The profile handle
671  * @param[in] address_family  The address family
672  * @param[out] type           The DNS config type
673  * @return 0 on success, otherwise negative error value.
674  * @retval #CONNECTION_ERROR_NONE               Successful
675  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
676  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
677  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
678  */
679 int connection_profile_get_dns_config_type(connection_profile_h profile,
680                 connection_address_family_e address_family, connection_dns_config_type_e *type);
681
682 /**
683  * @brief Gets the network prefix length.
684  * @since_tizen 4.0
685  * @param[in] profile         The profile handle
686  * @param[in] address_family  The address family
687  * @param[out] prefix_len     The network prefix length.
688  *                            In case of IPv4, it means netmask length
689  *                            (also called a prefix, e.g. 8, 16, 24, 32)
690  * @return 0 on success, otherwise negative error value.
691  * @retval #CONNECTION_ERROR_NONE               Successful
692  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
693  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
694  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
695  */
696 int connection_profile_get_prefix_length(connection_profile_h profile,
697                 connection_address_family_e address_family, int *prefix_len);
698
699 /**
700  * @brief Sets the network prefix length.
701  * @since_tizen 4.0
702  * @param[in] profile         The profile handle
703  * @param[in] address_family  The address family
704  * @param[in] prefix_len      The network prefix length.
705  *                            In case of IPv4, it means netmask length
706  *                            (also called a prefix, e.g. 8, 16, 24, 32)
707  * @return 0 on success, otherwise negative error value.
708  * @retval #CONNECTION_ERROR_NONE               Successful
709  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
710  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
711  * @retval #CONNECTION_ERROR_NOT_SUPPORTED      Not supported
712  * @see connection_update_profile()
713  */
714 int connection_profile_set_prefix_length(connection_profile_h profile,
715                 connection_address_family_e address_family, int prefix_len);
716
717 /**
718 * @}
719 */
720
721
722 /**
723 * @addtogroup CAPI_NETWORK_CONNECTION_WIFI_PROFILE_MODULE
724 * @{
725 */
726
727
728 /**
729  * @brief Gets the ESSID (Extended Service Set Identifier).
730  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
731  * @remarks You must release @a essid using free().
732  * @param[in] profile The profile handle
733  * @param[out] essid The ESSID
734  * @return @c 0 on success,
735  *         otherwise a negative error value
736  * @retval #CONNECTION_ERROR_NONE Successful
737  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
738  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
739  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
740 */
741 int connection_profile_get_wifi_essid(connection_profile_h profile, char** essid);
742
743
744 /**
745  * @brief Gets the BSSID (Basic Service Set Identifier).
746  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
747  * @remarks You must release @a bssid using free().
748  * @param[in] profile The profile handle
749  * @param[out] bssid The BSSID
750  * @return @c 0 on success,
751  *         otherwise a negative error value
752  * @retval #CONNECTION_ERROR_NONE Successful
753  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
754  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
755  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
756 */
757 int connection_profile_get_wifi_bssid(connection_profile_h profile, char** bssid);
758
759
760 /**
761  * @brief Gets the RSSI.
762  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
763  * @param[in] profile The profile handle
764  * @param[out] rssi The RSSI
765  * @return @c 0 on success,
766  *         otherwise a negative error value
767  * @retval #CONNECTION_ERROR_NONE Successful
768  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
769  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
770 */
771 int connection_profile_get_wifi_rssi(connection_profile_h profile, int* rssi);
772
773
774 /**
775  * @brief Gets the frequency (MHz).
776  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
777  * @param[in] profile The profile handle
778  * @param[out] frequency The frequency
779  * @return @c 0 on success,
780  *         otherwise a negative error value
781  * @retval #CONNECTION_ERROR_NONE Successful
782  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
783  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
784 */
785 int connection_profile_get_wifi_frequency(connection_profile_h profile, int* frequency);
786
787
788 /**
789  * @brief Gets the max speed (Mbps).
790  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
791  * @param[in] profile The profile handle
792  * @param[out] max_speed The max speed
793  * @return @c 0 on success,
794  *         otherwise a negative error value
795  * @retval #CONNECTION_ERROR_NONE Successful
796  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
797  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
798 */
799 int connection_profile_get_wifi_max_speed(connection_profile_h profile, int* max_speed);
800
801
802 /**
803  * @brief Gets the security mode of Wi-Fi.
804  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
805  * @param[in] profile The profile handle
806  * @param[out] type The type of Wi-Fi security
807  * @return @c 0 on success,
808  *         otherwise a negative error value
809  * @retval #CONNECTION_ERROR_NONE Successful
810  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
811  * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
812  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
813 */
814 int connection_profile_get_wifi_security_type(connection_profile_h profile, connection_wifi_security_type_e* type);
815
816
817 /**
818  * @brief Gets the security mode of Wi-Fi.
819  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
820  * @param[in] profile The profile handle
821  * @param[out] type The type of Wi-Fi security
822  * @return @c 0 on success,
823  *         otherwise a negative error value
824  * @retval #CONNECTION_ERROR_NONE Successful
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_wifi_encryption_type(connection_profile_h profile, connection_wifi_encryption_type_e* type);
830
831
832 /**
833  * @brief Checks whether passphrase is required.
834  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
835  * @remarks This function is not valid if security type is #CONNECTION_WIFI_SECURITY_TYPE_EAP.
836  * @param[in] profile The profile handle
837  * @param[out] required @c true if a passphrase is required,
838  *                      otherwise @c false if a passphrase is not required
839  * @return @c 0 on success,
840  *         otherwise a negative error value
841  * @retval #CONNECTION_ERROR_NONE Successful
842  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
843  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
844 */
845 int connection_profile_is_wifi_passphrase_required(connection_profile_h profile, bool* required);
846
847
848 /**
849  * @brief Sets the passphrase of the Wi-Fi WPA.
850  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
851  * @param[in] profile The profile handle
852  * @param[in] passphrase The passphrase of Wi-Fi security
853  * @return @c 0 on success,
854  *         otherwise a negative error value
855  * @retval #CONNECTION_ERROR_NONE Successful
856  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
857  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
858  * @see connection_update_profile()
859 */
860 int connection_profile_set_wifi_passphrase(connection_profile_h profile, const char* passphrase);
861
862
863 /**
864  * @brief Checks whether the WPS (Wi-Fi Protected Setup) is supported.
865  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
866  * @remarks If WPS is supported, you can connect the access point with WPS by wifi_connect_with_wps().
867  * @param[in] profile The profile handle
868  * @param[out] supported @c true if WPS is supported,
869  *                       otherwise @c false if WPS is not supported
870  * @return @c 0 on success,
871  *         otherwise negative error value
872  * @retval #CONNECTION_ERROR_NONE Successful
873  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
874  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
875 */
876 int connection_profile_is_wifi_wps_supported(connection_profile_h profile, bool* supported);
877
878
879 /**
880 * @}
881 */
882
883
884 /**
885 * @addtogroup CAPI_NETWORK_CONNECTION_CELLULAR_PROFILE_MODULE
886 * @{
887 */
888
889
890 /**
891  * @brief Gets the service type.
892  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
893  * @param[in] profile The profile handle
894  * @param[out] type The type of the cellular service
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_OPERATION_FAILED Operation failed
900  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
901 */
902 int connection_profile_get_cellular_service_type(connection_profile_h profile, connection_cellular_service_type_e* type);
903
904
905 /**
906  * @brief Gets the APN (access point name).
907  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
908  * @remarks You must release @a apn using free().
909  * @param[in] profile The profile handle
910  * @param[out] apn The name of the APN
911  * @return @c 0 on success,
912  *         otherwise a negative error value
913  * @retval #CONNECTION_ERROR_NONE Successful
914  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
915  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
916  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
917 */
918 int connection_profile_get_cellular_apn(connection_profile_h profile, char** apn);
919
920
921 /**
922  * @brief Gets the authentication information.
923  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
924  * @remarks You must release @a user_name and @a password using free().
925  * @param[in] profile The profile handle
926  * @param[out] type The type of the authentication
927  * @param[out] user_name The user name
928  * @param[out] password The password
929  * @return @c 0 on success,
930  *         otherwise a negative error value
931  * @retval #CONNECTION_ERROR_NONE Successful
932  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
933  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
934  * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
935  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
936 */
937 int connection_profile_get_cellular_auth_info(connection_profile_h profile, connection_cellular_auth_type_e* type, char** user_name, char** password);
938
939
940 /**
941  * @brief Gets the home URL.
942  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
943  * @remarks You must release @a home_url using free().
944  * @param[in] profile The profile handle
945  * @param[out] home_url The home URL
946  * @return @c 0 on success,
947  *         otherwise a negative error value
948  * @retval #CONNECTION_ERROR_NONE Successful
949  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
950  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
951  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
952 */
953 int connection_profile_get_cellular_home_url(connection_profile_h profile, char** home_url);
954
955
956 /**
957  * @brief Gets the cellular pdn type.
958  * @since_tizen 3.0
959  * @param[in] profile The profile handle
960  * @param[out] type The cellular pdn type
961  * @return @c 0 on success,
962  *         otherwise negative error value
963  * @retval #CONNECTION_ERROR_NONE Successful
964  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
965  * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
966  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not Supported
967 */
968 int connection_profile_get_cellular_pdn_type(connection_profile_h profile, connection_cellular_pdn_type_e* type);
969
970
971 /**
972  * @brief Gets the cellular roam pdn type.
973  * @since_tizen 3.0
974  * @param[in] profile The profile handle
975  * @param[out] type The cellular pdn type
976  * @return @c 0 on success,
977  *         otherwise negative error value
978  * @retval #CONNECTION_ERROR_NONE Successful
979  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
980  * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
981  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not Supported
982 */
983 int connection_profile_get_cellular_roam_pdn_type(connection_profile_h profile, connection_cellular_pdn_type_e* type);
984
985
986 /**
987  * @brief Checks whether the connection is in roaming state.
988  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
989  * @param[in] profile The profile handle
990  * @param[out] is_roaming @c true if the cellular is roaming,
991  *                        otherwise @c false if it is not roaming
992  * @return @c 0 on success,
993  *         otherwise a negative error value
994  * @retval #CONNECTION_ERROR_NONE Successful
995  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
996  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
997 */
998 int connection_profile_is_cellular_roaming(connection_profile_h profile, bool* is_roaming);
999
1000
1001 /**
1002  * @brief Checks whether the profile is hidden.
1003  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1004  * @param[in] profile The profile handle
1005  * @param[out] is_hidden @c true if the profile is in hidden,
1006  *                       otherwise @c false if the profile is not hidden
1007  * @return @c 0 on success,
1008  *         otherwise a negative error value
1009  * @retval #CONNECTION_ERROR_NONE Successful
1010  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1011  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1012 */
1013 int connection_profile_is_cellular_hidden(connection_profile_h profile, bool* is_hidden);
1014
1015
1016 /**
1017  * @brief Checks whether the profile is editable.
1018  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1019  * @param[in] profile  The profile handle
1020  * @param[out] is_editable @c true if the profile is editable,
1021  *                         otherwise @c false if the profile is not editable
1022  * @return @c 0 on success,
1023  *         otherwise a negative error value
1024  * @retval #CONNECTION_ERROR_NONE Successful
1025  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1026  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1027 */
1028 int connection_profile_is_cellular_editable(connection_profile_h profile, bool* is_editable);
1029
1030
1031 /**
1032  * @brief Checks whether the profile is default.
1033  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1034  * @param[in] profile The profile handle
1035  * @param[out] is_default @c true if the profile is default,
1036  *                        otherwise @c false if the profile is not default
1037  * @return @c 0 on success,
1038  *         otherwise a negative error value
1039  * @retval #CONNECTION_ERROR_NONE Successful
1040  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1041  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1042 */
1043 int connection_profile_is_cellular_default(connection_profile_h profile, bool* is_default);
1044
1045
1046 /**
1047  * @brief Sets the service type.
1048  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1049  * @param[in] profile The profile handle
1050  * @param[in] service_type The type of cellular service
1051  * @return @c 0 on success,
1052  *         otherwise a negative error value
1053  * @retval #CONNECTION_ERROR_NONE Successful
1054  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1055  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1056  * @see connection_update_profile()
1057 */
1058 int connection_profile_set_cellular_service_type(connection_profile_h profile, connection_cellular_service_type_e service_type);
1059
1060
1061 /**
1062  * @brief Sets the APN (Access Point Name).
1063  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1064  * @param[in] profile The profile handle
1065  * @param[in] apn The name of APN
1066  * @return @c 0 on success,
1067  *         otherwise a negative error value
1068  * @retval #CONNECTION_ERROR_NONE Successful
1069  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1070  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1071  * @see connection_update_profile()
1072 */
1073 int connection_profile_set_cellular_apn(connection_profile_h profile, const char* apn);
1074
1075
1076 /**
1077  * @brief Sets the Authentication information.
1078  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1079  * @param[in] profile The profile handle
1080  * @param[in] type The type of the authentication
1081  * @param[in] user_name The user name
1082  * @param[in] password The password
1083  * @return @c 0 on success,
1084  *         otherwise a negative error value
1085  * @retval #CONNECTION_ERROR_NONE Successful
1086  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1087  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1088  * @see connection_update_profile()
1089 */
1090 int connection_profile_set_cellular_auth_info(connection_profile_h profile, connection_cellular_auth_type_e type, const char* user_name, const char* password);
1091
1092
1093 /**
1094  * @brief Sets the home URL.
1095  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1096  * @param[in] profile The profile handle
1097  * @param[in] home_url The home URL
1098  * @return @c 0 on success,
1099  *         otherwise a negative error value
1100  * @retval #CONNECTION_ERROR_NONE Successful
1101  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1102  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1103  * @see connection_update_profile()
1104 */
1105 int connection_profile_set_cellular_home_url(connection_profile_h profile, const char* home_url);
1106
1107
1108 /**
1109  * @brief Sets the cellular pdn type.
1110  * @since_tizen 3.0
1111  * @param[in] profile The profile handle
1112  * @param[in] type The cellular pdn type
1113  * @return @c 0 on success,
1114  *         otherwise negative error value
1115  * @retval #CONNECTION_ERROR_NONE Successful
1116  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1117  * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1118  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not Supported
1119 */
1120 int connection_profile_set_cellular_pdn_type(connection_profile_h profile, connection_cellular_pdn_type_e type);
1121
1122
1123 /**
1124  * @brief Sets the cellular roam pdn type.
1125  * @since_tizen 3.0
1126  * @param[in] profile The profile handle
1127  * @param[in] type The cellular pdn type
1128  * @return @c 0 on success,
1129  *         otherwise negative error value
1130  * @retval #CONNECTION_ERROR_NONE Successful
1131  * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1132  * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1133  * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
1134  * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not Supported
1135 */
1136 int connection_profile_set_cellular_roam_pdn_type(connection_profile_h profile, connection_cellular_pdn_type_e type);
1137
1138
1139 /**
1140 * @}
1141 */
1142
1143
1144 #ifdef __cplusplus
1145 }
1146
1147
1148 #endif
1149
1150
1151 #endif /* __TIZEN_NETWORK_CONNECTION_PROFILE_H__ */