9ad8ef63be039a06bbee7ea9df02f6892c720fb3
[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 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,
101         CONNECTION_MPTCP_ENABLE_ALL = 1,
102         CONNECTION_MPTCP_ENABLE_SOCKOPT = 2,
103 } connection_mptcp_enable_e;
104
105 typedef enum {
106         CONNECTION_MPTCP_PM_UNKNOWN,
107         CONNECTION_MPTCP_PM_DEFAULT,
108         CONNECTION_MPTCP_PM_FULLMESH,
109 } connection_mptcp_path_manager_e;
110
111 typedef enum {
112         CONNECTION_MPTCP_SCHEDULER_UNKNOWN,
113         CONNECTION_MPTCP_SCHEDULER_DEFAULT,
114         CONNECTION_MPTCP_SCHEDULER_ROUNDROBIN,
115 } connection_mptcp_scheduler_e;
116
117 int connection_mptcp_enable(connection_mptcp_enable_e enable);
118 int connection_mptcp_disable(void);
119 int connection_mptcp_get_enabled(connection_mptcp_enable_e* enable);
120
121 int connection_mptcp_set_path_manager(connection_mptcp_path_manager_e pm);
122 int connection_mptcp_get_path_manager(connection_mptcp_path_manager_e* pm);
123
124 int connection_mptcp_set_scheduler(connection_mptcp_scheduler_e scheduler);
125 int connection_mptcp_get_scheduler(connection_mptcp_scheduler_e* scheduler);
126
127 /**
128 * @}
129 */
130
131
132 #ifdef __cplusplus
133 }
134 #endif /* __cplusplus */
135
136
137 #endif /* __TIZEN_NETWORK_CONNECTION_EXTENSION_H__ */