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 Start TCP Dump.
34 * @param[in] connection The connection handle
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
41 int connection_profile_start_tcpdump(connection_h connection);
44 * @brief Stop TCP Dump.
46 * @param[in] connection The connection handle
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
53 int connection_profile_stop_tcpdump(connection_h connection);
56 * @brief Get TCP Dump Running Status.
58 * @param[in] connection The connection handle
59 * @param[out] tcpdump_state The state of tcpdump, tcpdump is in progress or not
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
66 int connection_profile_get_tcpdump_state(connection_h connection, gboolean *tcpdump_state);
69 * @brief Creates a handle for managing data connections in C# API.
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()
84 int connection_create_cs(int tid, connection_h *connection);
87 * @brief Destroys the connection handle in C# API.
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()
97 int connection_destroy_cs(int tid, connection_h connection);
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;
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;
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;
118 * @brief Check if Multipath TCP is supported
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
126 int connection_mptcp_is_supported(connection_h connection, bool* supported);
129 * @brief Enable Multipath TCP
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
141 int connection_mptcp_enable(connection_h connection, connection_mptcp_enable_e enable);
144 * @brief Disable Multipath TCP
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
155 int connection_mptcp_disable(connection_h connection);
158 * @brief Get the enabled value for Multipath TCP
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
170 int connection_mptcp_get_enabled(connection_h connection, connection_mptcp_enable_e* enable);
173 * @brief Set the path manager of Multipath TCP
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
185 int connection_mptcp_set_path_manager(connection_h connection, connection_mptcp_path_manager_e pm);
188 * @brief Get the path manager of Multipath TCP
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
200 int connection_mptcp_get_path_manager(connection_h connection, connection_mptcp_path_manager_e* pm);
203 * @brief Set the path manager of Multipath TCP
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
215 int connection_mptcp_set_scheduler(connection_h connection, connection_mptcp_scheduler_e scheduler);
218 * @brief Set the path manager of Multipath TCP
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
230 int connection_mptcp_get_scheduler(connection_h connection, connection_mptcp_scheduler_e* scheduler);
239 #endif /* __cplusplus */
242 #endif /* __TIZEN_NETWORK_CONNECTION_EXTENSION_H__ */