Added APIs to support EAPoL connection.
[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  * @pre This function needs connection_profile_set_ethernet_eap_type() before use.
372  */
373 int connection_profile_set_ethernet_eap_auth_type(connection_profile_h profile,
374                                                 connection_ethernet_eap_auth_type_e type);
375
376 /**
377  * @brief Gets the type of EAP phase2 authentication of ethernet.
378  * @since_tizen 6.0
379  * @param[in] profile           The profile handle
380  * @param[out] type             The type of EAP phase2 authentication
381  * @return 0 on success, otherwise negative error value
382  * @retval #CONNECTION_ERROR_NONE                 Successful
383  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
384  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
385  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
386  */
387 int connection_profile_get_ethernet_eap_auth_type(connection_profile_h profile,
388                                                 connection_ethernet_eap_auth_type_e *type);
389
390 /**
391  * @brief Sets anonymous identity of EAP over ethernet.
392  * @since_tizen 6.0
393  * @param[in] profile                   The profile handle
394  * @param[in] anonymous_identity        The anonymous identity
395  * @return 0 on success, otherwise negative error value
396  * @retval #CONNECTION_ERROR_NONE                 Successful
397  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
398  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
399  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
400  */
401 int connection_profile_set_ethernet_eap_anonymous_identity(connection_profile_h profile,
402                                                         const char *anonymous_identity);
403
404 /**
405  * @brief Gets anonymous identity of EAP over ethernet.
406  * @since_tizen 6.0
407  * @remarks You must release @a anonymous_identity using free().
408  * @param[in] profile                   The profile handle
409  * @param[out] anonymous_identity   The anonymous identity of ethernet.
410  * @return 0 on success, otherwise negative error value
411  * @retval #CONNECTION_ERROR_NONE                 Successful
412  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
413  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY                Out of memory
414  * @retval #CONNECTION_ERROR_INVALID_OPERATION            Invalid operation
415  * @retval #CONNECTION_ERROR_NOT_SUPPORTED                Not supported
416  */
417 int connection_profile_get_ethernet_eap_anonymous_identity(connection_profile_h profile,
418                                                         char **anonymous_identity);
419
420 /**
421  * @brief Sets the CA Certificate of EAP.
422  * @since_tizen 6.0
423  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_TLS,
424  *      #CONNECTION_ETHERNET_EAP_TYPE_TTLS or #CONNECTION_ETHERNET_EAP_TYPE_PEAP.
425  * @param[in] profile           The profile handle
426  * @param[in] file              The file path of CA Certificate
427  * @return 0 on success, otherwise negative error value
428  * @retval #CONNECTION_ERROR_NONE                 Successful
429  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
430  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
431  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
432  */
433 int connection_profile_set_ethernet_eap_ca_cert_file(connection_profile_h profile, const char *file);
434
435 /**
436  * @brief Gets the CA Certificate of EAP.
437  * @since_tizen 6.0
438  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_TLS,
439  *      #CONNECTION_ETHERNET_EAP_TYPE_TTLS or #CONNECTION_ETHERNET_EAP_TYPE_PEAP.
440  *      You must release @a file using free().
441  * @param[in] profile           The profile handle
442  * @param[out] file             The file path of CA Certificate
443  * @return 0 on success, otherwise negative error value
444  * @retval #CONNECTION_ERROR_NONE                 Successful
445  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
446  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY        Out of memory
447  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
448  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
449  */
450 int connection_profile_get_ethernet_eap_ca_cert_file(connection_profile_h profile, char **file);
451
452 /**
453  * @brief Sets the Client Certificate of EAP.
454  * @since_tizen 6.0
455  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_TLS.
456  * @param[in] profile           The profile handle
457  * @param[out] file             The file path of Client Certificate
458  * @return 0 on success, otherwise negative error value
459  * @retval #CONNECTION_ERROR_NONE                 Successful
460  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
461  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
462  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
463  */
464 int connection_profile_set_ethernet_eap_client_cert_file(connection_profile_h profile, const char *file);
465
466 /**
467  * @brief Gets the Client Certificate of EAP.
468  * @since_tizen 6.0
469  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_TLS.
470  *      You must release @a file using free().
471  * @param[in] profile           The profile handle
472  * @param[out] file             The file path of Client Certificate
473  * @return 0 on success, otherwise negative error value
474  * @retval #CONNECTION_ERROR_NONE                 Successful
475  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
476  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY        Out of memory
477  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
478  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
479  */
480 int connection_profile_get_ethernet_eap_client_cert_file(connection_profile_h profile, char **file);
481
482 /**
483  * @brief Sets the PAC file of EAP.
484  * @since_tizen 6.0
485  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_FAST.
486  * @param[in] profile           The profile handle
487  * @param[out] file             The path of PAC file
488  * @return 0 on success, otherwise negative error value
489  * @retval #CONNECTION_ERROR_NONE                 Successful
490  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
491  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
492  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
493  */
494 int connection_profile_set_ethernet_eap_pac_file(connection_profile_h profile, const char *file);
495
496 /**
497  * @brief Gets the PAC file of EAP.
498  * @since_tizen 6.0
499  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_FAST.
500  *      You must release @a file using free().
501  * @param[in] profile           The profile handle
502  * @param[out] file             The path of PAC file
503  * @return 0 on success, otherwise negative error value
504  * @retval #CONNECTION_ERROR_NONE                 Successful
505  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
506  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY        Out of memory
507  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
508  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
509  */
510 int connection_profile_get_ethernet_eap_pac_file(connection_profile_h profile, char **file);
511
512 /**
513  * @brief Sets the version of EAP-PEAP of ethernet.
514  * @since_tizen 6.0
515  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_PEAP.
516  * @param[in] profile           The profile handle
517  * @param[in] version           The version of EAP-PEAP.
518  * @return 0 on success, otherwise negative error value
519  * @retval #CONNECTION_ERROR_NONE                       Successful
520  * @retval #CONNECTION_ERROR_INVALID_PARAMETER          Invalid parameter
521  * @retval #CONNECTION_ERROR_INVALID_OPERATION          Invalid operation
522  * @retval #CONNECTION_ERROR_NOT_SUPPORTED              Not supported
523  */
524 int connection_profile_set_ethernet_eap_peap_version(connection_profile_h profile,
525                                                 connection_ethernet_eap_peap_version_e version);
526
527 /**
528  * @brief Gets the version of EAP-PEAP of ethernet.
529  * @since_tizen 6.0
530  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_PEAP.
531  * @param[in] profile           The profile handle
532  * @param[out] version          The version of EAP-PEAP.
533  * @return 0 on success, otherwise negative error value
534  * @retval #CONNECTION_ERROR_NONE                 Successful
535  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
536  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
537  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
538  */
539 int connection_profile_get_ethernet_eap_peap_version(connection_profile_h profile,
540                                                 connection_ethernet_eap_peap_version_e *version);
541
542 /**
543  * @brief Sets the identity of EAP over ethernet.
544  * @since_tizen 6.0
545  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_TLS.
546  * @param[in] profile           The profile handle
547  * @param[in] identity          The identity
548  * @return 0 on success, otherwise negative error value
549  * @retval #CONNECTION_ERROR_NONE                 Successful
550  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
551  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
552  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
553  */
554 int connection_profile_set_ethernet_eap_identity(connection_profile_h profile, const char *identity);
555
556 /**
557  * @brief Gets the identity of EAP over ethernet.
558  * @since_tizen 6.0
559  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_TLS.
560  *      You must release @a identity using free().
561  * @param[in] profile           The profile handle
562  * @param[out] identity         The identity of ethernet.
563  * @return 0 on success, otherwise negative error value
564  * @retval #CONNECTION_ERROR_NONE                       Successful
565  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
566  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY              Out of memory
567  * @retval #CONNECTION_ERROR_INVALID_OPERATION  Invalid operation
568  * @retval #CONNECTION_ERROR_NOT_SUPPORTED              Not supported
569  */
570 int connection_profile_get_ethernet_eap_identity(connection_profile_h profile, char **identity);
571
572 /**
573  * @brief Sets the private key information of EAP.
574  * @since_tizen 6.0
575  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_TLS.
576  * @param[in] profile           The profile handle
577  * @param[in] file              The file path of private key
578  * @param[in] password          The password
579  * @return 0 on success, otherwise negative error value
580  * @retval #CONNECTION_ERROR_NONE                 Successful
581  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
582  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
583  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
584  */
585 int connection_profile_set_ethernet_eap_private_key_info(connection_profile_h profile,
586                                                         const char *file, const char *password);
587 /**
588  * @brief Gets the private key file of EAP.
589  * @since_tizen 6.0
590  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_TLS.
591  *      You must release @a file using free().
592  * @param[in] profile           The profile handle
593  * @param[out] file             The file path of private key
594  * @return 0 on success, otherwise negative error value
595  * @retval #CONNECTION_ERROR_NONE                 Successful
596  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
597  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY        Out of memory
598  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
599  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
600  */
601 int connection_profile_get_ethernet_eap_private_key_file(connection_profile_h profile, char **file);
602
603 /**
604  * @brief Sets the user name and passphrase of EAP.
605  * @since_tizen 6.0
606  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_MD5,
607  *      #CONNECTION_ETHERNET_EAP_TYPE_PEAP, #CONNECTION_ETHERNET_EAP_TYPE_TTLS or #CONNECTION_ETHERNET_EAP_TYPE_FAST.
608  * @param[in] profile           The profile handle
609  * @param[in] user_name         The user name
610  * @param[in] password          The password
611  * @return 0 on success, otherwise negative error value
612  * @retval #CONNECTION_ERROR_NONE                 Successful
613  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
614  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
615  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
616  */
617 int connection_profile_set_ethernet_eap_passphrase(connection_profile_h profile,
618                                                         const char *user_name, const char *password);
619
620 /**
621  * @brief Gets the username and password status of EAP.
622  * @since_tizen 6.0
623  * @remarks This function is valid only if the EAP type is #CONNECTION_ETHERNET_EAP_TYPE_MD5,
624  *      #CONNECTION_ETHERNET_EAP_TYPE_PEAP, #CONNECTION_ETHERNET_EAP_TYPE_TTLS or #CONNECTION_ETHERNET_EAP_TYPE_FAST.
625  *      You must release @a user_name using free().
626  * @param[in] profile           The profile handle
627  * @param[out] user_name        The user name
628  * @param[out] is_password_set  @c true if password is set,
629  *                otherwise @c false if password is not set.
630  * @return 0 on success, otherwise negative error value
631  * @retval #CONNECTION_ERROR_NONE                 Successful
632  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
633  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY        Out of memory
634  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
635  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
636  */
637 int connection_profile_get_ethernet_eap_passphrase(connection_profile_h profile,
638                                                 char **user_name, bool *is_password_set);
639
640 /**
641  * @brief Removes configuration of ethernet profile.
642  * @since_tizen 6.0
643  * @privlevel public
644  * @privilege %http://tizen.org/privilege/network.profile
645  *
646  * @param[in] connection        The connection handle
647  * @param[in] profile           The profile handle
648  * @return 0 on success, otherwise negative error value
649  * @retval #CONNECTION_ERROR_NONE                 Successful
650  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
651  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
652  * @retval #CONNECTION_ERROR_PERMISSION_DENIED    Permission denied
653  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
654  * @see connection_profile_create()
655  * @see connection_profile_foreach_ethernet_eap_config()
656  */
657 int connection_profile_remove_ethernet_eap_config(connection_h connection,
658                                                         connection_profile_h profile);
659
660 /**
661  * @brief Saves configuration of ethernet profile.
662  * @details When a configuration is changed, these changes will be not applied to the Connection Manager immediately.\n
663  *            When you call this function, your changes affect the Connection Manager and the existing configuration is updated.
664  * @since_tizen 6.0
665  * @privlevel public
666  * @privilege %http://tizen.org/privilege/network.profile
667  *
668  * @param[in] connection        The connection handle
669  * @param[in] profile           The profile handle
670  * @return 0 on success, otherwise negative error value
671  * @retval #CONNECTION_ERROR_NONE                 Successful
672  * @retval #CONNECTION_ERROR_INVALID_OPERATION    Invalid operation
673  * @retval #CONNECTION_ERROR_INVALID_PARAMETER    Invalid parameter
674  * @retval #CONNECTION_ERROR_PERMISSION_DENIED    Permission denied
675  * @retval #CONNECTION_ERROR_NOT_SUPPORTED        Not supported
676  * @see connection_profile_create()
677  */
678 int connection_profile_save_ethernet_eap_config(connection_h connection,
679                                                         connection_profile_h profile);
680
681 /**
682 * @}
683 */
684
685
686 #ifdef __cplusplus
687 }
688 #endif /* __cplusplus */
689
690
691 #endif /* __TIZEN_NETWORK_CONNECTION_EXTENSION_H__ */