[connection] Added Tizen Wi-Fi Mesh
[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 "network-mptcp-intf.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 Enumeration for extended security type of Wi-Fi.
41  * @since_tizen 5.0
42  */
43 typedef enum {
44         CONNECTION_WIFI_SECURITY_TYPE_SAE = CONNECTION_WIFI_SECURITY_TYPE_EAP + 1,  /**< SAE */
45 } connection_wifi_security_type_extended_e;
46
47 /**
48  * @brief Start TCP Dump.
49  *
50  * @param[in] connection        The connection handle
51  *
52  * @return @c 0 on success, otherwise a negative error value
53  * @retval #CONNECTION_ERROR_NONE                    Successful
54  * @retval #CONNECTION_ERROR_OPERATION_FAILED        Operation failed
55  * @retval #CONNECTION_ERROR_INVALID_PARAMETER       Invalid parameter
56 */
57 int connection_profile_start_tcpdump(connection_h connection);
58
59 /**
60  * @brief Stop TCP Dump.
61  *
62  * @param[in] connection        The connection handle
63  *
64  * @return @c 0 on success, otherwise a negative error value
65  * @retval #CONNECTION_ERROR_NONE                    Successful
66  * @retval #CONNECTION_ERROR_OPERATION_FAILED        Operation failed
67  * @retval #CONNECTION_ERROR_INVALID_PARAMETER       Invalid parameter
68 */
69 int connection_profile_stop_tcpdump(connection_h connection);
70
71 /**
72  * @brief Get TCP Dump Running Status.
73  *
74  * @param[in] connection        The connection handle
75  * @param[out] tcpdump_state    The state of tcpdump, tcpdump is in progress or not
76  *
77  * @return @c 0 on success, otherwise a negative error value
78  * @retval #CONNECTION_ERROR_NONE                    Successful
79  * @retval #CONNECTION_ERROR_OPERATION_FAILED        Operation failed
80  * @retval #CONNECTION_ERROR_INVALID_PARAMETER       Invalid parameter
81 */
82 int connection_profile_get_tcpdump_state(connection_h connection, gboolean *tcpdump_state);
83
84 /**
85  * @brief Creates a handle for managing data connections in C# API.
86  * @since_tizen 5.0
87  * @privlevel public
88  * @privilege %http://tizen.org/privilege/network.get
89  * @remarks You must release @a handle using connection_destroy_cs().
90  * @param[in]  tid              TID in C#
91  * @param[out] connection       The connection handle
92  * @return @c 0 on success,
93  *         otherwise a negative error value
94  * @retval #CONNECTION_ERROR_NONE                  Successful
95  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
96  * @retval #CONNECTION_ERROR_OUT_OF_MEMORY         Out of memory
97  * @retval #CONNECTION_ERROR_PERMISSION_DENIED     Permission denied
98  * @see connection_destroy_cs()
99  */
100 int connection_create_cs(int tid, connection_h *connection);
101
102 /**
103  * @brief Destroys the connection handle in C# API.
104  * @since_tizen 5.0
105  * @param[in]  tid              TID in C#
106  * @param[in] connection        The connection handle
107  * @return @c 0 on success,
108  *         otherwise a negative error value
109  * @retval #CONNECTION_ERROR_NONE                  Successful
110  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
111  * @see connection_create_cs()
112  */
113 int connection_destroy_cs(int tid, connection_h connection);
114
115 typedef enum {
116         CONNECTION_MPTCP_DISABLE = 0,                   // disable
117         CONNECTION_MPTCP_ENABLE_ALL = 1,                // enable
118         CONNECTION_MPTCP_ENABLE_SOCKOPT = 2,    // enable if the MPTCP_ENABLED socket option is set
119 } connection_mptcp_enable_e;
120
121 typedef enum {
122         CONNECTION_MPTCP_PM_UNKNOWN,                    // Unknown path manager
123         CONNECTION_MPTCP_PM_DEFAULT,                    // Default path manager - Do nothing
124         CONNECTION_MPTCP_PM_FULLMESH,                   // Full mesh of subflows
125 } connection_mptcp_path_manager_e;
126
127 typedef enum {
128         CONNECTION_MPTCP_SCHEDULER_UNKNOWN,             // Unknown scheduler
129         CONNECTION_MPTCP_SCHEDULER_DEFAULT,             // Default scheduler
130         CONNECTION_MPTCP_SCHEDULER_ROUNDROBIN,  // Round robin scheduler
131 } connection_mptcp_scheduler_e;
132
133 /**
134  * @brief Check if Multipath TCP is supported
135  * @since_tizen 5.0
136  * @param[in] connection        The connection handle
137  * @param[out] supported        true if Multipath TCP is supported, false otherwise
138  * @return @c 0 on success,
139  *         otherwise a negative error value
140  * @retval #CONNECTION_ERROR_NONE                               Successful
141  */
142 int connection_mptcp_is_supported(connection_h connection, bool* supported);
143
144 /**
145  * @brief Enable Multipath TCP
146  * @since_tizen 5.0
147  * @param[in] connection        The connection handle
148  * @param[in] enable    The enabled value
149  * @return @c 0 on success,
150  *         otherwise a negative error value
151  * @retval #CONNECTION_ERROR_NONE                               Successful
152  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
153  * @retval #CONNECTION_ERROR_NOT_SUPPORTED              Not supported
154  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
155  * @retval #CONNECTION_ERROR_PERMISSION_DENIED  Permission denied
156  */
157 int connection_mptcp_enable(connection_h connection, connection_mptcp_enable_e enable);
158
159 /**
160  * @brief Disable Multipath TCP
161  * @since_tizen 5.0
162  * @param[in] connection        The connection handle
163  * @return @c 0 on success,
164  *         otherwise a negative error value
165  * @retval #CONNECTION_ERROR_NONE                               Successful
166  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
167  * @retval #CONNECTION_ERROR_NOT_SUPPORTED              Not supported
168  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
169  * @retval #CONNECTION_ERROR_PERMISSION_DENIED  Permission denied
170  */
171 int connection_mptcp_disable(connection_h connection);
172
173 /**
174  * @brief Get the enabled value for Multipath TCP
175  * @since_tizen 5.0
176  * @param[in] connection        The connection handle
177  * @param[out] enable   The enabled value
178  * @return @c 0 on success,
179  *         otherwise a negative error value
180  * @retval #CONNECTION_ERROR_NONE                               Successful
181  * @retval #CONNECTION_ERROR_INVALID_PARAMETER  Invalid parameter
182  * @retval #CONNECTION_ERROR_NOT_SUPPORTED              Not supported
183  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
184  * @retval #CONNECTION_ERROR_PERMISSION_DENIED  Permission denied
185  */
186 int connection_mptcp_get_enabled(connection_h connection, connection_mptcp_enable_e* enable);
187
188 /**
189  * @brief Set the path manager of Multipath TCP
190  * @since_tizen 5.0
191  * @param[in] connection        The connection handle
192  * @param[in] pm        The path manager of Multipath TCP
193  * @return @c 0 on success,
194  *         otherwise a negative error value
195  * @retval #CONNECTION_ERROR_NONE                               Successful
196  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
197  * @retval #CONNECTION_ERROR_NOT_SUPPORTED              Not supported
198  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
199  * @retval #CONNECTION_ERROR_PERMISSION_DENIED  Permission denied
200  */
201 int connection_mptcp_set_path_manager(connection_h connection, connection_mptcp_path_manager_e pm);
202
203 /**
204  * @brief Get the path manager of Multipath TCP
205  * @since_tizen 5.0
206  * @param[in] connection        The connection handle
207  * @param[out] pm       The path manager of Multipath TCP
208  * @return @c 0 on success,
209  *         otherwise a negative error value
210  * @retval #CONNECTION_ERROR_NONE                               Successful
211  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
212  * @retval #CONNECTION_ERROR_NOT_SUPPORTED              Not supported
213  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
214  * @retval #CONNECTION_ERROR_PERMISSION_DENIED  Permission denied
215  */
216 int connection_mptcp_get_path_manager(connection_h connection, connection_mptcp_path_manager_e* pm);
217
218 /**
219  * @brief Set the path manager of Multipath TCP
220  * @since_tizen 5.0
221  * @param[in] connection        The connection handle
222  * @param[in] scheduler         The schedduler of Multipath TCP
223  * @return @c 0 on success,
224  *         otherwise a negative error value
225  * @retval #CONNECTION_ERROR_NONE                               Successful
226  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
227  * @retval #CONNECTION_ERROR_NOT_SUPPORTED              Not supported
228  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
229  * @retval #CONNECTION_ERROR_PERMISSION_DENIED  Permission denied
230  */
231 int connection_mptcp_set_scheduler(connection_h connection, connection_mptcp_scheduler_e scheduler);
232
233 /**
234  * @brief Set the path manager of Multipath TCP
235  * @since_tizen 5.0
236  * @param[in] connection        The connection handle
237  * @param[out] scheduler                The schedduler of Multipath TCP
238  * @return @c 0 on success,
239  *         otherwise a negative error value
240  * @retval #CONNECTION_ERROR_NONE                               Successful
241  * @retval #CONNECTION_ERROR_INVALID_PARAMETER     Invalid parameter
242  * @retval #CONNECTION_ERROR_NOT_SUPPORTED              Not supported
243  * @retval #CONNECTION_ERROR_OPERATION_FAILED   Operation failed
244  * @retval #CONNECTION_ERROR_PERMISSION_DENIED  Permission denied
245  */
246 int connection_mptcp_get_scheduler(connection_h connection, connection_mptcp_scheduler_e* scheduler);
247
248 /**
249 * @}
250 */
251
252
253 #ifdef __cplusplus
254 }
255 #endif /* __cplusplus */
256
257
258 #endif /* __TIZEN_NETWORK_CONNECTION_EXTENSION_H__ */