Separate source code from internal header
[platform/core/api/smart-traffic-control.git] / include / stc_stat_internal.h
1 /*
2  * Smart Traffic Control (STC)
3  *
4  * Copyright (c) 2017 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 #ifndef __TIZEN_STC_STAT_INTERNAL_H__
21 #define __TIZEN_STC_STAT_INTERNAL_H__
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 /**
28  * @file stc_internal.h
29  */
30
31 /*****************************************************************************
32  *  Standard headers
33  *****************************************************************************/
34 #include <tizen.h>
35 #include <time.h>
36 #include <inttypes.h>
37
38 /*****************************************************************************
39  *  Macros and Typedefs
40  *****************************************************************************/
41
42 /**
43  * @addtogroup CAPI_NETWORK_STC_STATISTICS_MODULE
44  * @{
45  */
46
47 /**
48  * @brief The reset rule handle.
49  * @since_tizen 4.0
50  */
51 typedef void *stc_reset_rule_h;
52
53
54 /**
55 * @}
56 */
57
58 /*****************************************************************************
59  *  Enumeration
60  *****************************************************************************/
61
62 /*****************************************************************************
63  *  Callback functions
64  *****************************************************************************/
65
66 /*****************************************************************************
67  *  Core API functions
68  *****************************************************************************/
69
70 /**
71  * @addtogroup CAPI_NETWORK_STC_STATISTICS_MODULE
72  * @{
73  */
74
75 /**
76  * @brief Creates the reset rule handle.
77  * @since_tizen 4.0
78  * @privlevel platform
79  * @privilege %http://tizen.org/privilege/network.get
80  * @remarks You must release @a handle using stc_reset_rule_destroy().
81  *
82  * @param[in] stc The stc handle
83  * @param[out] rule The reset rule handle
84  *
85  * @return 0 on success, otherwise a negative error value
86  * @retval #STC_ERROR_NONE Successful
87  * @retval #STC_ERROR_OPERATION_FAILED General error
88  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
89  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
90  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
91  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
92  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
93  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
94  *
95  * @see #stc_h
96  * @see #stc_reset_rule_h
97  * @see stc_initialize()
98  * @see stc_reset_rule_destroy()
99  */
100 int stc_reset_rule_create(stc_h stc, stc_reset_rule_h *rule);
101
102 /**
103  * @brief Destroys the reset rule handle.
104  * @since_tizen 4.0
105  * @privlevel platform
106  * @privilege %http://tizen.org/privilege/network.get
107  *
108  * @param[in] rule The reset rule handle
109  *
110  * @return 0 on success, otherwise a negative error value
111  * @retval #STC_ERROR_NONE Successful
112  * @retval #STC_ERROR_OPERATION_FAILED General error
113  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
114  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
115  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
116  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
117  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
118  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
119  *
120  * @see #stc_reset_rule_h
121  * @see stc_reset_rule_create()
122  */
123 int stc_reset_rule_destroy(stc_reset_rule_h rule);
124
125 /**
126  * @brief Sets the application ID for reset rule.
127  * @since_tizen 4.0
128  * @privlevel platform
129  * @privilege %http://tizen.org/privilege/network.get
130  *
131  * @param[in] rule The reset rule handle
132  * @param[in] app_id The application ID
133  *
134  * @return 0 on success, otherwise a negative error value
135  * @retval #STC_ERROR_NONE Successful
136  * @retval #STC_ERROR_OPERATION_FAILED General error
137  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
138  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
139  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
140  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
141  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
142  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
143  *
144  * @see #stc_reset_rule_h
145  * @see stc_reset_rule_create()
146  * @see stc_reset_rule_destroy()
147  * @see stc_reset_rule_get_app_id()
148  */
149 int stc_reset_rule_set_app_id(stc_reset_rule_h rule, const char *app_id);
150
151 /**
152  * @brief Sets the subscriber ID for reset rule.
153  * @since_tizen 4.0
154  * @privlevel platform
155  * @privilege %http://tizen.org/privilege/network.get
156  *
157  * @param[in] rule The reset rule handle
158  * @param[in] subscriber_id The subscriber ID
159  *
160  * @return 0 on success, otherwise a negative error value
161  * @retval #STC_ERROR_NONE Successful
162  * @retval #STC_ERROR_OPERATION_FAILED General error
163  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
164  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
165  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
166  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
167  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
168  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
169  *
170  * @see #stc_reset_rule_h
171  * @see stc_reset_rule_create()
172  * @see stc_reset_rule_destroy()
173  * @see stc_reset_rule_get_subscriber_id()
174  */
175 int stc_reset_rule_set_subscriber_id(stc_reset_rule_h rule, const char *subscriber_id);
176
177 /**
178  * @brief Sets the interface type for reset rule.
179  * @since_tizen 4.0
180  * @privlevel platform
181  * @privilege %http://tizen.org/privilege/network.get
182  *
183  * @param[in] rule The reset rule handle
184  * @param[in] iface_type The interface type
185  *
186  * @return 0 on success, otherwise a negative error value
187  * @retval #STC_ERROR_NONE Successful
188  * @retval #STC_ERROR_OPERATION_FAILED General error
189  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
190  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
191  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
192  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
193  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
194  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
195  *
196  * @see #stc_reset_rule_h
197  * @see #stc_iface_type_e
198  * @see stc_reset_rule_create()
199  * @see stc_reset_rule_destroy()
200  * @see stc_reset_rule_get_iface_type()
201  */
202 int stc_reset_rule_set_iface_type(stc_reset_rule_h rule,
203                 stc_iface_type_e iface_type);
204
205 /**
206  * @brief Sets the time interval for reset rule.
207  * @since_tizen 4.0
208  * @privlevel platform
209  * @privilege %http://tizen.org/privilege/network.get
210  *
211  * @param[in] rule The reset rule handle
212  * @param[in] from The time interval from
213  * @param[in] to The time interval to
214  *
215  * @return 0 on success, otherwise a negative error value
216  * @retval #STC_ERROR_NONE Successful
217  * @retval #STC_ERROR_OPERATION_FAILED General error
218  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
219  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
220  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
221  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
222  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
223  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
224  *
225  * @see #stc_reset_rule_h
226  * @see stc_reset_rule_create()
227  * @see stc_reset_rule_destroy()
228  * @see stc_reset_rule_get_time_interval()
229  */
230 int stc_reset_rule_set_time_interval(stc_reset_rule_h rule,
231                 time_t from, time_t to);
232
233 /**
234  * @brief Gets the application ID for reset.
235  * @since_tizen 4.0
236  * @privlevel platform
237  * @privilege %http://tizen.org/privilege/network.get
238  *
239  * @param[in] rule The reset rule handle
240  * @param[out] app_id The application ID
241  *
242  * @return 0 on success, otherwise a negative error value
243  * @retval #STC_ERROR_NONE Successful
244  * @retval #STC_ERROR_OPERATION_FAILED General error
245  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
246  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
247  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
248  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
249  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
250  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
251  *
252  * @see #stc_reset_rule_h
253  * @see stc_reset_rule_create()
254  * @see stc_reset_rule_destroy()
255  * @see stc_reset_rule_set_app_id()
256  */
257 int stc_reset_rule_get_app_id(stc_reset_rule_h rule, char **app_id);
258
259 /**
260  * @brief Gets the subscriber ID for reset rule.
261  * @since_tizen 4.0
262  * @privlevel platform
263  * @privilege %http://tizen.org/privilege/network.get
264  *
265  * @param[in] rule The reset rule handle
266  * @param[out] subscriber_id The subscriber ID
267  *
268  * @return 0 on success, otherwise a negative error value
269  * @retval #STC_ERROR_NONE Successful
270  * @retval #STC_ERROR_OPERATION_FAILED General error
271  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
272  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
273  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
274  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
275  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
276  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
277  *
278  * @see #stc_reset_rule_h
279  * @see stc_reset_rule_create()
280  * @see stc_reset_rule_destroy()
281  * @see stc_reset_rule_set_subscriber_id()
282  */
283 int stc_reset_rule_get_subscriber_id(stc_reset_rule_h rule, char **subscriber_id);
284
285 /**
286  * @brief Gets the interface type for reset rule.
287  * @since_tizen 4.0
288  * @privlevel platform
289  * @privilege %http://tizen.org/privilege/network.get
290  *
291  * @param[in] rule The reset rule handle
292  * @param[out] iface_type The interface type
293  *
294  * @return 0 on success, otherwise a negative error value
295  * @retval #STC_ERROR_NONE Successful
296  * @retval #STC_ERROR_OPERATION_FAILED General error
297  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
298  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
299  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
300  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
301  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
302  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
303  *
304  * @see #stc_reset_rule_h
305  * @see #stc_iface_type_e
306  * @see stc_reset_rule_create()
307  * @see stc_reset_rule_destroy()
308  * @see stc_reset_rule_set_iface_type()
309  */
310 int stc_reset_rule_get_iface_type(stc_reset_rule_h rule,
311                 stc_iface_type_e *iface_type);
312
313 /**
314  * @brief Gets the time interval for reset rule.
315  * @since_tizen 4.0
316  * @privlevel platform
317  * @privilege %http://tizen.org/privilege/network.get
318  *
319  * @param[in] rule The reset rule handle
320  * @param[out] from The time interval from
321  * @param[out] to The time interval to
322  *
323  * @return 0 on success, otherwise a negative error value
324  * @retval #STC_ERROR_NONE Successful
325  * @retval #STC_ERROR_OPERATION_FAILED General error
326  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
327  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
328  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
329  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
330  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
331  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
332  *
333  * @see #stc_reset_rule_h
334  * @see stc_reset_rule_create()
335  * @see stc_reset_rule_destroy()
336  * @see stc_reset_rule_set_time_interval()
337  */
338 int stc_reset_rule_get_time_interval(stc_reset_rule_h rule,
339                 time_t *from, time_t *to);
340
341 /**
342  * @brief Gets the subscriber ID from statistics information.
343  * @since_tizen 4.0
344  * @remarks You must release @a subscriber ID using free().
345  *
346  * @param[in] info The statistics information handle
347  * @param[out] subscriber_id The subscriber ID
348  *
349  * @return 0 on success, otherwise a negative error value
350  * @retval #STC_ERROR_NONE                    Successful
351  * @retval #STC_ERROR_OPERATION_FAILED        General error
352  * @retval #STC_ERROR_OUT_OF_MEMORY           Out of memory
353  * @retval #STC_ERROR_INVALID_PARAMETER       Invalid parameter
354  * @retval #STC_ERROR_INVALID_OPERATION       Invalid operation
355  * @retval #STC_ERROR_NOT_INITIALIZED         Not initialized
356  * @retval #STC_ERROR_NOT_SUPPORTED           Not supported
357  * @retval #STC_ERROR_PERMISSION_DENIED       Permission denied
358  *
359  * @see stc_stats_info_h
360  * @see stc_stats_info_cb()
361  */
362 int stc_stats_info_get_subscriber_id(stc_stats_info_h info, char **subscriber_id);
363
364 /**
365 * @}
366 */
367
368 #ifdef __cplusplus
369 }
370 #endif
371
372 #endif /* __TIZEN_STC_STAT_INTERNAL_H__ */