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