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