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