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 Enumeration for extended security type of Wi-Fi.
44 CONNECTION_WIFI_SECURITY_TYPE_SAE = CONNECTION_WIFI_SECURITY_TYPE_EAP + 1, /**< SAE */
45 } connection_wifi_security_type_extended_e;
48 * @brief Start TCP Dump.
50 * @param[in] connection The connection handle
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
57 int connection_profile_start_tcpdump(connection_h connection);
60 * @brief Stop TCP Dump.
62 * @param[in] connection The connection handle
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
69 int connection_profile_stop_tcpdump(connection_h connection);
72 * @brief Get TCP Dump Running Status.
74 * @param[in] connection The connection handle
75 * @param[out] tcpdump_state The state of tcpdump, tcpdump is in progress or not
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
82 int connection_profile_get_tcpdump_state(connection_h connection, gboolean *tcpdump_state);
85 * @brief Creates a handle for managing data connections in C# API.
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()
100 int connection_create_cs(int tid, connection_h *connection);
103 * @brief Destroys the connection handle in C# API.
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()
113 int connection_destroy_cs(int tid, connection_h connection);
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;
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;
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;
134 * @brief Check if Multipath TCP is supported
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
142 int connection_mptcp_is_supported(connection_h connection, bool* supported);
145 * @brief Enable Multipath TCP
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
157 int connection_mptcp_enable(connection_h connection, connection_mptcp_enable_e enable);
160 * @brief Disable Multipath TCP
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
171 int connection_mptcp_disable(connection_h connection);
174 * @brief Get the enabled value for Multipath TCP
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
186 int connection_mptcp_get_enabled(connection_h connection, connection_mptcp_enable_e* enable);
189 * @brief Set the path manager of Multipath TCP
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
201 int connection_mptcp_set_path_manager(connection_h connection, connection_mptcp_path_manager_e pm);
204 * @brief Get the path manager of Multipath TCP
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
216 int connection_mptcp_get_path_manager(connection_h connection, connection_mptcp_path_manager_e* pm);
219 * @brief Set the path manager of Multipath TCP
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
231 int connection_mptcp_set_scheduler(connection_h connection, connection_mptcp_scheduler_e scheduler);
234 * @brief Set the path manager of Multipath TCP
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
246 int connection_mptcp_get_scheduler(connection_h connection, connection_mptcp_scheduler_e* scheduler);
255 #endif /* __cplusplus */
258 #endif /* __TIZEN_NETWORK_CONNECTION_EXTENSION_H__ */