Added prototype of APIs for EAP over ethernet.
[platform/core/api/connection.git] / include / connection_extension.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 #ifndef __TIZEN_NETWORK_CONNECTION_EXTENSION_H__
18 #define __TIZEN_NETWORK_CONNECTION_EXTENSION_H__
19
20 #include "net_connection.h"
21 #include <glib.h>
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 /**
28  * @file connection_extension.h
29  */
30
31 /**
32  * @brief Enumeration for extended network connection type.
33  * @since_tizen 5.0
34  */
35 typedef enum {
36         CONNECTION_PROFILE_TYPE_MESH = CONNECTION_PROFILE_TYPE_BT + 1,  /**< Wi-Fi Mesh type */
37 } connection_profile_type_extended_e;
38
39 /**
40  * @brief Start TCP Dump.
41  *
42  * @param[in] connection        The connection handle
43  *
44  * @return @c 0 on success, otherwise a negative error value
45  * @retval #CONNECTION_ERROR_NONE                    Successful
46  * @retval #CONNECTION_ERROR_OPERATION_FAILED        Operation failed
47  * @retval #CONNECTION_ERROR_INVALID_PARAMETER       Invalid parameter
48 */
49 int connection_profile_start_tcpdump(connection_h connection);
50
51 /**
52  * @brief Stop TCP Dump.
53  *
54  * @param[in] connection        The connection handle
55  *
56  * @return @c 0 on success, otherwise a negative error value
57  * @retval #CONNECTION_ERROR_NONE                    Successful
58  * @retval #CONNECTION_ERROR_OPERATION_FAILED        Operation failed
59  * @retval #CONNECTION_ERROR_INVALID_PARAMETER       Invalid parameter
60 */
61 int connection_profile_stop_tcpdump(connection_h connection);
62
63 /**
64  * @brief Get TCP Dump Running Status.
65  *
66  * @param[in] connection        The connection handle
67  * @param[out] tcpdump_state    The state of tcpdump, tcpdump is in progress or not
68  *
69  * @return @c 0 on success, otherwise a negative error value
70  * @retval #CONNECTION_ERROR_NONE                    Successful
71  * @retval #CONNECTION_ERROR_OPERATION_FAILED        Operation failed
72  * @retval #CONNECTION_ERROR_INVALID_PARAMETER       Invalid parameter
73 */
74 int connection_profile_get_tcpdump_state(connection_h connection, gboolean *tcpdump_state);
75
76 /**
77  * @brief Creates a handle for managing data connections in C# API.
78  * @since_tizen 5.0
79  * @privlevel public
80  * @privilege %http://tizen.org/privilege/network.get
81  * @remarks You must release @a handle using connection_destroy_cs().
82  * @param[in]  tid              TID in C#
83  * @param[out] connection       The connection handle
84  * @return @c 0 on success,
85  *         otherwise a negative error value
86  * @retval #CONNECTION_ERROR_NONE                  Successful
87  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
88  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY         Out of memory
89  * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
90  * @see connection_destroy_cs()
91  */
92 int connection_create_cs(int tid, connection_h *connection);
93
94 /**
95  * @brief Destroys the connection handle in C# API.
96  * @since_tizen 5.0
97  * @param[in]  tid              TID in C#
98  * @param[in] connection        The connection handle
99  * @return @c 0 on success,
100  *         otherwise a negative error value
101  * @retval #CONNECTION_ERROR_NONE                  Successful
102  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
103  * @see connection_create_cs()
104  */
105 int connection_destroy_cs(int tid, connection_h connection);
106
107 typedef enum {
108         CONNECTION_MPTCP_DISABLE = 0,                   // disable
109         CONNECTION_MPTCP_ENABLE_ALL = 1,                // enable
110         CONNECTION_MPTCP_ENABLE_SOCKOPT = 2,    // enable if the MPTCP_ENABLED socket option is set
111 } connection_mptcp_enable_e;
112
113 typedef enum {
114         CONNECTION_MPTCP_PM_UNKNOWN,                    // Unknown path manager
115         CONNECTION_MPTCP_PM_DEFAULT,                    // Default path manager - Do nothing
116         CONNECTION_MPTCP_PM_FULLMESH,                   // Full mesh of subflows
117 } connection_mptcp_path_manager_e;
118
119 typedef enum {
120         CONNECTION_MPTCP_SCHEDULER_UNKNOWN,             // Unknown scheduler
121         CONNECTION_MPTCP_SCHEDULER_DEFAULT,             // Default scheduler
122         CONNECTION_MPTCP_SCHEDULER_ROUNDROBIN,  // Round robin scheduler
123 } connection_mptcp_scheduler_e;
124
125 /**
126  * @brief Check if Multipath TCP is supported
127  * @since_tizen 5.0
128  * @param[in] connection        The connection handle
129  * @param[out] supported        true if Multipath TCP is supported, false otherwise
130  * @return @c 0 on success,
131  *         otherwise a negative error value
132  * @retval #CONNECTION_ERROR_NONE                               Successful
133  */
134 int connection_mptcp_is_supported(connection_h connection, bool* supported);
135
136 /**
137  * @brief Enable Multipath TCP
138  * @since_tizen 5.0
139  * @param[in] connection        The connection handle
140  * @param[in] enable    The enabled value
141  * @return @c 0 on success,
142  *         otherwise a negative error value
143  * @retval #CONNECTION_ERROR_NONE                               Successful
144  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
145  * @retval #CONNECTION_ERROR_NOT_SUPPORTED              Not supported
146  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
147  * @retval #CONNECTION_ERROR_PERMISSION_DENIED  Permission denied
148  */
149 int connection_mptcp_enable(connection_h connection, connection_mptcp_enable_e enable);
150
151 /**
152  * @brief Disable Multipath TCP
153  * @since_tizen 5.0
154  * @param[in] connection        The connection handle
155  * @return @c 0 on success,
156  *         otherwise a negative error value
157  * @retval #CONNECTION_ERROR_NONE                               Successful
158  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
159  * @retval #CONNECTION_ERROR_NOT_SUPPORTED              Not supported
160  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
161  * @retval #CONNECTION_ERROR_PERMISSION_DENIED  Permission denied
162  */
163 int connection_mptcp_disable(connection_h connection);
164
165 /**
166  * @brief Get the enabled value for Multipath TCP
167  * @since_tizen 5.0
168  * @param[in] connection        The connection handle
169  * @param[out] enable   The enabled value
170  * @return @c 0 on success,
171  *         otherwise a negative error value
172  * @retval #CONNECTION_ERROR_NONE                               Successful
173  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
174  * @retval #CONNECTION_ERROR_NOT_SUPPORTED              Not supported
175  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
176  * @retval #CONNECTION_ERROR_PERMISSION_DENIED  Permission denied
177  */
178 int connection_mptcp_get_enabled(connection_h connection, connection_mptcp_enable_e* enable);
179
180 /**
181  * @brief Set the path manager of Multipath TCP
182  * @since_tizen 5.0
183  * @param[in] connection        The connection handle
184  * @param[in] pm        The path manager of Multipath TCP
185  * @return @c 0 on success,
186  *         otherwise a negative error value
187  * @retval #CONNECTION_ERROR_NONE                               Successful
188  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
189  * @retval #CONNECTION_ERROR_NOT_SUPPORTED              Not supported
190  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
191  * @retval #CONNECTION_ERROR_PERMISSION_DENIED  Permission denied
192  */
193 int connection_mptcp_set_path_manager(connection_h connection, connection_mptcp_path_manager_e pm);
194
195 /**
196  * @brief Get the path manager of Multipath TCP
197  * @since_tizen 5.0
198  * @param[in] connection        The connection handle
199  * @param[out] pm       The path manager of Multipath TCP
200  * @return @c 0 on success,
201  *         otherwise a negative error value
202  * @retval #CONNECTION_ERROR_NONE                               Successful
203  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
204  * @retval #CONNECTION_ERROR_NOT_SUPPORTED              Not supported
205  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
206  * @retval #CONNECTION_ERROR_PERMISSION_DENIED  Permission denied
207  */
208 int connection_mptcp_get_path_manager(connection_h connection, connection_mptcp_path_manager_e* pm);
209
210 /**
211  * @brief Set the path manager of Multipath TCP
212  * @since_tizen 5.0
213  * @param[in] connection        The connection handle
214  * @param[in] scheduler         The schedduler of Multipath TCP
215  * @return @c 0 on success,
216  *         otherwise a negative error value
217  * @retval #CONNECTION_ERROR_NONE                               Successful
218  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
219  * @retval #CONNECTION_ERROR_NOT_SUPPORTED              Not supported
220  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
221  * @retval #CONNECTION_ERROR_PERMISSION_DENIED  Permission denied
222  */
223 int connection_mptcp_set_scheduler(connection_h connection, connection_mptcp_scheduler_e scheduler);
224
225 /**
226  * @brief Set the path manager of Multipath TCP
227  * @since_tizen 5.0
228  * @param[in] connection        The connection handle
229  * @param[out] scheduler                The schedduler of Multipath TCP
230  * @return @c 0 on success,
231  *         otherwise a negative error value
232  * @retval #CONNECTION_ERROR_NONE                               Successful
233  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
234  * @retval #CONNECTION_ERROR_NOT_SUPPORTED              Not supported
235  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
236  * @retval #CONNECTION_ERROR_PERMISSION_DENIED  Permission denied
237  */
238 int connection_mptcp_get_scheduler(connection_h connection, connection_mptcp_scheduler_e* scheduler);
239
240 /**
241  * @brief Enumeration for EAP type.
242  * @since_tizen 6.0
243  */
244 typedef enum {
245         CONNECTION_ETHERNET_EAP_TYPE_MD5 = 0,        /**< EAP MD5 type */
246         CONNECTION_ETHERNET_EAP_TYPE_PEAP = 1,       /**< EAP PEAP type */
247         CONNECTION_ETHERNET_EAP_TYPE_TLS = 2,          /**< EAP TLS type */
248         CONNECTION_ETHERNET_EAP_TYPE_TTLS = 3,        /**< EAP TTLS type */
249         CONNECTION_ETHERNET_EAP_TYPE_FAST = 4,        /**< EAP FAST type */
250 } connection_ethernet_eap_type_e;
251
252 /**
253  * @brief Enumeration for EAP phase2 authentication type.
254  * @since_tizen 6.0
255  */
256 typedef enum {
257         CONNECTION_ETHERNET_EAP_AUTH_TYPE_NONE = 0,            /**< EAP phase2 authentication none */
258         CONNECTION_ETHERNET_EAP_AUTH_TYPE_PAP = 1,                /**< EAP phase2 authentication PAP */
259         CONNECTION_ETHERNET_EAP_AUTH_TYPE_MSCHAP = 2,       /**< EAP phase2 authentication MSCHAP */
260         CONNECTION_ETHERNET_EAP_AUTH_TYPE_MSCHAPV2 = 3,  /**< EAP phase2 authentication MSCHAPv2 */
261         CONNECTION_ETHERNET_EAP_AUTH_TYPE_GTC = 4,               /**< EAP phase2 authentication GTC */
262         CONNECTION_ETHERNET_EAP_AUTH_TYPE_MD5 = 5,             /**< EAP phase2 authentication MD5 */
263 } connection_ethernet_eap_auth_type_e;
264
265 /**
266  * @brief Enumeration for PEAP version.
267  * @since_tizen 6.0
268  */
269 typedef enum {
270         CONNECTION_ETHERNET_EAP_PEAP_VERSION_AUTO = 0, /**< PEAP version Automatic */
271         CONNECTION_ETHERNET_EAP_PEAP_VERSION_0 = 1,         /**< PEAP version 0 */
272         CONNECTION_ETHERNET_EAP_PEAP_VERSION_1 = 2,         /**< PEAP version 1 */
273 } connection_ethernet_eap_peap_version_e;
274
275 /**
276  * @brief Called for each found ethernet configuration.
277  * @since_tizen 6.0
278  * @param[in] profile           The profile handle
279  * @param[in] user_data         The user data passed from the request function
280  * @return @c true to continue with the next iteration of the loop, otherwise @c false to break out of the loop \n
281  * @pre connection_profile_foreach_ethernet_eap_config() will invoke this callback.
282  * @see connection_profile_foreach_ethernet_eap_config()
283  */
284 typedef bool (*connection_profile_list_cb)(connection_profile_h profile, void *user_data);
285
286 /**
287  * @brief Gets configurations of an ethernet.
288  * @since_tizen 6.0
289  * @privlevel public
290  * @privilege %http://tizen.org/privilege/network.profile
291  *
292  * @param[in] connection        The connection handle
293  * @param[in] callback          The callback to be called
294  * @param[in] user_data         The user data passed to the callback function
295  * @return 0 on success, otherwise negative error value
296  * @retval #CONNECTION_ERROR_NONE                 Successful
297  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
298  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
299  * @retval #CONNECTION_ERROR_PERMISSION_DENIED    Permission denied
300  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
301  * @pre This function needs connection_create() before use.
302  * @post This function invokes connection_profile_list_cb().
303  */
304 int connection_profile_foreach_ethernet_eap_config(connection_h connection,
305                                                 connection_profile_list_cb callback, void *user_data);
306
307 /**
308  * @brief Enable EAP over ethernet network
309  * @since_tizen 6.0
310  * @param[in] profile           The profile handle
311  * @param[in] enable            The flag to enable or disable EAP over ethernet
312  * @return @c 0 on success, otherwise a negative error value
313  * @retval #CONNECTION_ERROR_NONE                       Successful
314  * @retval #CONNECTION_ERROR_INVALID_PARAMETER          Invalid parameter
315  * @retval #CONNECTION_ERROR_PERMISSION_DENIED          Permission denied
316  * @retval #CONNECTION_ERROR_OPERATION_FAILED           Operation Failed
317  * @retval #CONNECTION_ERROR_NOT_SUPPORTED              Not supported
318  */
319 int connection_profile_enable_ethernet_eap(connection_profile_h profile, bool enable);
320
321 /**
322  * @brief Check if EAP over ethernet is enabled.
323  * @since_tizen 6.0
324  * @param[in] profile           The profile handle
325  * @param[out] enabled          true if EAP over ethernet is enabled, false otherwise
326  * @return @c 0 on success, otherwise a negative error value
327  * @retval #CONNECTION_ERROR_NONE                       Successful
328  * @retval #CONNECTION_ERROR_INVALID_PARAMETER          Invalid parameter
329  * @retval #CONNECTION_ERROR_PERMISSION_DENIED          Permission denied
330  * @retval #CONNECTION_ERROR_OPERATION_FAILED           Operation Failed
331  * @retval #CONNECTION_ERROR_NOT_SUPPORTED              Not supported
332  */
333 int connection_profile_is_ethernet_eap_enabled(connection_profile_h profile, bool *enabled);
334
335 /**
336  * @brief Sets the EAP type of ethernet.
337  * @since_tizen 6.0
338  * @param[in] profile           The profile handle
339  * @param[in] type              The type of EAP
340  * @return 0 on success, otherwise negative error value
341  * @retval #CONNECTION_ERROR_NONE                 Successful
342  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
343  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
344  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
345  */
346 int connection_profile_set_ethernet_eap_type(connection_profile_h profile, connection_ethernet_eap_type_e type);
347
348 /**
349  * @brief Gets the EAP type of ethernet.
350  * @since_tizen 6.0
351  * @param[in] profile           The profile handle
352  * @param[out] type             The type of EAP
353  * @return 0 on success, otherwise negative error value
354  * @retval #CONNECTION_ERROR_NONE                 Successful
355  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
356  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
357  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
358  */
359 int connection_profile_get_ethernet_eap_type(connection_profile_h profile, connection_ethernet_eap_type_e *type);
360
361 /**
362  * @brief Sets the type of EAP phase2 authentication of ethernet.
363  * @since_tizen 6.0
364  * @param[in] profile           The profile handle
365  * @param[in] type              The type of EAP phase2 authentication
366  * @return 0 on success, otherwise negative error value
367  * @retval #CONNECTION_ERROR_NONE                       Successful
368  * @retval #CONNECTION_ERROR_INVALID_PARAMETER          Invalid parameter
369  * @retval #CONNECTION_ERROR_INVALID_OPERATION          Invalid operation
370  * @retval #CONNECTION_ERROR_NOT_SUPPORTED              Not supported
371  */
372 int connection_profile_set_ethernet_eap_auth_type(connection_profile_h profile,
373                                                 connection_ethernet_eap_auth_type_e type);
374
375 /**
376  * @brief Gets the type of EAP phase2 authentication of ethernet.
377  * @since_tizen 6.0
378  * @param[in] profile           The profile handle
379  * @param[out] type             The type of EAP phase2 authentication
380  * @return 0 on success, otherwise negative error value
381  * @retval #CONNECTION_ERROR_NONE                 Successful
382  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
383  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
384  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
385  */
386 int connection_profile_get_ethernet_eap_auth_type(connection_profile_h profile,
387                                                 connection_ethernet_eap_auth_type_e *type);
388
389 /**
390  * @brief Sets anonymous identity of EAP over ethernet.
391  * @since_tizen 6.0
392  * @param[in] profile                   The profile handle
393  * @param[in] anonymous_identity        The anonymous identity
394  * @return 0 on success, otherwise negative error value
395  * @retval #CONNECTION_ERROR_NONE                 Successful
396  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
397  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
398  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
399  */
400 int connection_profile_set_ethernet_eap_anonymous_identity(connection_profile_h profile,
401                                                         const char *anonymous_identity);
402
403 /**
404  * @brief Gets anonymous identity of EAP over ethernet.
405  * @since_tizen 6.0
406  * @remarks You must release @a anonymous_identity using free().
407  * @param[in] profile                   The profile handle
408  * @param[out] anonymous_identity   The anonymous identity of ethernet.
409  * @return 0 on success, otherwise negative error value
410  * @retval #CONNECTION_ERROR_NONE                 Successful
411  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
412  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY                Out of memory
413  * @retval #CONNECTION_ERROR_INVALID_OPERATION            Invalid operation
414  * @retval #CONNECTION_ERROR_NOT_SUPPORTED                Not supported
415  */
416 int connection_profile_get_ethernet_eap_anonymous_identity(connection_profile_h profile,
417                                                         char **anonymous_identity);
418
419 /**
420  * @brief Sets the CA Certificate of EAP.
421  * @since_tizen 6.0
422  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_TLS,
423  *      #CONNECTION_ETHERNET_EAP_TYPE_TTLS or #CONNECTION_ETHERNET_EAP_TYPE_PEAP.
424  * @param[in] profile           The profile handle
425  * @param[in] file              The file path of CA Certificate
426  * @return 0 on success, otherwise negative error value
427  * @retval #CONNECTION_ERROR_NONE                 Successful
428  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
429  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
430  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
431  */
432 int connection_profile_set_ethernet_eap_ca_cert_file(connection_profile_h profile, const char *file);
433
434 /**
435  * @brief Gets the CA Certificate of EAP.
436  * @since_tizen 6.0
437  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_TLS,
438  *      #CONNECTION_ETHERNET_EAP_TYPE_TTLS or #CONNECTION_ETHERNET_EAP_TYPE_PEAP.
439  *      You must release @a file using free().
440  * @param[in] profile           The profile handle
441  * @param[out] file             The file path of CA Certificate
442  * @return 0 on success, otherwise negative error value
443  * @retval #CONNECTION_ERROR_NONE                 Successful
444  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
445  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY        Out of memory
446  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
447  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
448  */
449 int connection_profile_get_ethernet_eap_ca_cert_file(connection_profile_h profile, char **file);
450
451 /**
452  * @brief Sets the Client Certificate of EAP.
453  * @since_tizen 6.0
454  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_TLS.
455  * @param[in] profile           The profile handle
456  * @param[out] file             The file path of Client Certificate
457  * @return 0 on success, otherwise negative error value
458  * @retval #CONNECTION_ERROR_NONE                 Successful
459  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
460  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
461  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
462  */
463 int connection_profile_set_ethernet_eap_client_cert_file(connection_profile_h profile, const char *file);
464
465 /**
466  * @brief Gets the Client Certificate of EAP.
467  * @since_tizen 6.0
468  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_TLS.
469  *      You must release @a file using free().
470  * @param[in] profile           The profile handle
471  * @param[out] file             The file path of Client Certificate
472  * @return 0 on success, otherwise negative error value
473  * @retval #CONNECTION_ERROR_NONE                 Successful
474  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
475  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY        Out of memory
476  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
477  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
478  */
479 int connection_profile_get_ethernet_eap_client_cert_file(connection_profile_h profile, char **file);
480
481 /**
482  * @brief Sets the PAC file of EAP.
483  * @since_tizen 6.0
484  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_FAST.
485  * @param[in] profile           The profile handle
486  * @param[out] file             The path of PAC file
487  * @return 0 on success, otherwise negative error value
488  * @retval #CONNECTION_ERROR_NONE                 Successful
489  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
490  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
491  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
492  */
493 int connection_profile_set_ethernet_eap_pac_file(connection_profile_h profile, const char *file);
494
495 /**
496  * @brief Gets the PAC file of EAP.
497  * @since_tizen 6.0
498  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_FAST.
499  *      You must release @a file using free().
500  * @param[in] profile           The profile handle
501  * @param[out] file             The path of PAC file
502  * @return 0 on success, otherwise negative error value
503  * @retval #CONNECTION_ERROR_NONE                 Successful
504  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
505  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY        Out of memory
506  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
507  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
508  */
509 int connection_profile_get_ethernet_eap_pac_file(connection_profile_h profile, char **file);
510
511 /**
512  * @brief Sets the version of EAP-PEAP of ethernet.
513  * @since_tizen 6.0
514  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_PEAP.
515  * @param[in] profile           The profile handle
516  * @param[in] version           The version of EAP-PEAP.
517  * @return 0 on success, otherwise negative error value
518  * @retval #CONNECTION_ERROR_NONE                       Successful
519  * @retval #CONNECTION_ERROR_INVALID_PARAMETER          Invalid parameter
520  * @retval #CONNECTION_ERROR_INVALID_OPERATION          Invalid operation
521  * @retval #CONNECTION_ERROR_NOT_SUPPORTED              Not supported
522  */
523 int connection_profile_set_ethernet_eap_peap_version(connection_profile_h profile,
524                                                 connection_ethernet_eap_peap_version_e version);
525
526 /**
527  * @brief Gets the version of EAP-PEAP of ethernet.
528  * @since_tizen 6.0
529  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_PEAP.
530  * @param[in] profile           The profile handle
531  * @param[out] version          The version of EAP-PEAP.
532  * @return 0 on success, otherwise negative error value
533  * @retval #CONNECTION_ERROR_NONE                 Successful
534  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
535  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
536  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
537  */
538 int connection_profile_get_ethernet_eap_peap_version(connection_profile_h profile,
539                                                 connection_ethernet_eap_peap_version_e *version);
540
541 /**
542  * @brief Sets the identity of EAP over ethernet.
543  * @since_tizen 6.0
544  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_TLS.
545  * @param[in] profile           The profile handle
546  * @param[in] identity          The identity
547  * @return 0 on success, otherwise negative error value
548  * @retval #CONNECTION_ERROR_NONE                 Successful
549  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
550  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
551  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
552  */
553 int connection_profile_set_ethernet_eap_identity(connection_profile_h profile, const char *identity);
554
555 /**
556  * @brief Gets the identity of EAP over ethernet.
557  * @since_tizen 6.0
558  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_TLS.
559  *      You must release @a identity using free().
560  * @param[in] profile           The profile handle
561  * @param[out] identity         The identity of ethernet.
562  * @return 0 on success, otherwise negative error value
563  * @retval #CONNECTION_ERROR_NONE                       Successful
564  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
565  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY              Out of memory
566  * @retval #CONNECTION_ERROR_INVALID_OPERATION  Invalid operation
567  * @retval #CONNECTION_ERROR_NOT_SUPPORTED              Not supported
568  */
569 int connection_profile_get_ethernet_eap_identity(connection_profile_h profile, char **identity);
570
571 /**
572  * @brief Sets the private key information of EAP.
573  * @since_tizen 6.0
574  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_TLS.
575  * @param[in] profile           The profile handle
576  * @param[in] file              The file path of private key
577  * @param[in] password          The password
578  * @return 0 on success, otherwise negative error value
579  * @retval #CONNECTION_ERROR_NONE                 Successful
580  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
581  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
582  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
583  */
584 int connection_profile_set_ethernet_eap_private_key_info(connection_profile_h profile,
585                                                         const char *file, const char *password);
586 /**
587  * @brief Gets the private key file of EAP.
588  * @since_tizen 6.0
589  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_TLS.
590  *      You must release @a file using free().
591  * @param[in] profile           The profile handle
592  * @param[out] file             The file path of private key
593  * @return 0 on success, otherwise negative error value
594  * @retval #CONNECTION_ERROR_NONE                 Successful
595  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
596  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY        Out of memory
597  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
598  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
599  */
600 int connection_profile_get_ethernet_eap_private_key_file(connection_profile_h profile, char **file);
601
602 /**
603  * @brief Sets the user name and passphrase of EAP.
604  * @since_tizen 6.0
605  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_MD5,
606  *      #CONNECTION_ETHERNET_EAP_TYPE_PEAP, #CONNECTION_ETHERNET_EAP_TYPE_TTLS or #CONNECTION_ETHERNET_EAP_TYPE_FAST.
607  * @param[in] profile           The profile handle
608  * @param[in] user_name         The user name
609  * @param[in] password          The password
610  * @return 0 on success, otherwise negative error value
611  * @retval #CONNECTION_ERROR_NONE                 Successful
612  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
613  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
614  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
615  */
616 int connection_profile_set_ethernet_eap_passphrase(connection_profile_h profile,
617                                                         const char *user_name, const char *password);
618
619 /**
620  * @brief Gets the username and password status of EAP.
621  * @since_tizen 6.0
622  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_MD5,
623  *      #CONNECTION_ETHERNET_EAP_TYPE_PEAP, #CONNECTION_ETHERNET_EAP_TYPE_TTLS or #CONNECTION_ETHERNET_EAP_TYPE_FAST.
624  *      You must release @a user_name using free().
625  * @param[in] profile           The profile handle
626  * @param[out] user_name        The user name
627  * @param[out] is_password_set  @c true if password is set,
628  *                otherwise @c false if password is not set.
629  * @return 0 on success, otherwise negative error value
630  * @retval #CONNECTION_ERROR_NONE                 Successful
631  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
632  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY        Out of memory
633  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
634  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
635  */
636 int connection_profile_get_ethernet_eap_passphrase(connection_profile_h profile,
637                                                 char **user_name, bool *is_password_set);
638
639 /**
640  * @brief Removes configuration of ethernet profile.
641  * @since_tizen 6.0
642  * @privlevel public
643  * @privilege %http://tizen.org/privilege/network.profile
644  *
645  * @param[in] connection        The connection handle
646  * @param[in] profile           The profile handle
647  * @return 0 on success, otherwise negative error value
648  * @retval #CONNECTION_ERROR_NONE                 Successful
649  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
650  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
651  * @retval #CONNECTION_ERROR_PERMISSION_DENIED    Permission denied
652  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
653  * @see connection_profile_create()
654  * @see connection_profile_foreach_ethernet_eap_config()
655  */
656 int connection_profile_remove_ethernet_eap_config(connection_h connection,
657                                                         connection_profile_h profile);
658
659 /**
660  * @brief Saves configuration of ethernet profile.
661  * @details When a configuration is changed, these changes will be not applied to the Connection Manager immediately.\n
662  *            When you call this function, your changes affect the Connection Manager and the existing configuration is updated.
663  * @since_tizen 6.0
664  * @privlevel public
665  * @privilege %http://tizen.org/privilege/network.profile
666  *
667  * @param[in] connection        The connection handle
668  * @param[in] profile           The profile handle
669  * @return 0 on success, otherwise negative error value
670  * @retval #CONNECTION_ERROR_NONE                 Successful
671  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
672  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
673  * @retval #CONNECTION_ERROR_PERMISSION_DENIED    Permission denied
674  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
675  * @see connection_profile_create()
676  */
677 int connection_profile_save_ethernet_eap_config(connection_h connection,
678                                                         connection_profile_h profile);
679
680 /**
681 * @}
682 */
683
684
685 #ifdef __cplusplus
686 }
687 #endif /* __cplusplus */
688
689
690 #endif /* __TIZEN_NETWORK_CONNECTION_EXTENSION_H__ */