2 * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __TIZEN_NETWORK_CONNECTION_EXTENSION_H__
18 #define __TIZEN_NETWORK_CONNECTION_EXTENSION_H__
20 #include "net_connection.h"
28 * @file connection_extension.h
32 * @brief Enumeration for extended network connection type.
36 CONNECTION_PROFILE_TYPE_MESH = CONNECTION_PROFILE_TYPE_BT + 1, /**< Wi-Fi Mesh type */
37 } connection_profile_type_extended_e;
40 * @brief Start TCP Dump.
42 * @param[in] connection The connection handle
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
49 int connection_profile_start_tcpdump(connection_h connection);
52 * @brief Stop TCP Dump.
54 * @param[in] connection The connection handle
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
61 int connection_profile_stop_tcpdump(connection_h connection);
64 * @brief Get TCP Dump Running Status.
66 * @param[in] connection The connection handle
67 * @param[out] tcpdump_state The state of tcpdump, tcpdump is in progress or not
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
74 int connection_profile_get_tcpdump_state(connection_h connection, gboolean *tcpdump_state);
77 * @brief Creates a handle for managing data connections in C# API.
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()
92 int connection_create_cs(int tid, connection_h *connection);
95 * @brief Destroys the connection handle in C# API.
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()
105 int connection_destroy_cs(int tid, connection_h connection);
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;
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;
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;
126 * @brief Check if Multipath TCP is supported
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
134 int connection_mptcp_is_supported(connection_h connection, bool* supported);
137 * @brief Enable Multipath TCP
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
149 int connection_mptcp_enable(connection_h connection, connection_mptcp_enable_e enable);
152 * @brief Disable Multipath TCP
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
163 int connection_mptcp_disable(connection_h connection);
166 * @brief Get the enabled value for Multipath TCP
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
178 int connection_mptcp_get_enabled(connection_h connection, connection_mptcp_enable_e* enable);
181 * @brief Set the path manager of Multipath TCP
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
193 int connection_mptcp_set_path_manager(connection_h connection, connection_mptcp_path_manager_e pm);
196 * @brief Get the path manager of Multipath TCP
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
208 int connection_mptcp_get_path_manager(connection_h connection, connection_mptcp_path_manager_e* pm);
211 * @brief Set the path manager of Multipath TCP
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
223 int connection_mptcp_set_scheduler(connection_h connection, connection_mptcp_scheduler_e scheduler);
226 * @brief Set the path manager of Multipath TCP
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
238 int connection_mptcp_get_scheduler(connection_h connection, connection_mptcp_scheduler_e* scheduler);
247 #endif /* __cplusplus */
250 #endif /* __TIZEN_NETWORK_CONNECTION_EXTENSION_H__ */