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