2 * Smart Traffic Control (STC)
4 * Copyright (c) 2017 Samsung Electronics Co., Ltd. All rights reserved.
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 #ifndef __TIZEN_STC_STAT_INTERNAL_H__
21 #define __TIZEN_STC_STAT_INTERNAL_H__
28 * @file stc_internal.h
31 /*****************************************************************************
33 *****************************************************************************/
38 /*****************************************************************************
40 *****************************************************************************/
43 * @addtogroup CAPI_NETWORK_STC_STATISTICS_MODULE
48 * @brief The reset rule handle.
51 typedef void *stc_reset_rule_h;
58 /*****************************************************************************
60 *****************************************************************************/
62 /*****************************************************************************
64 *****************************************************************************/
66 /*****************************************************************************
68 *****************************************************************************/
71 * @addtogroup CAPI_NETWORK_STC_STATISTICS_MODULE
76 * @brief Creates the reset rule handle.
79 * @privilege %http://tizen.org/privilege/network.get
80 * @remarks You must release @a handle using stc_reset_rule_destroy().
82 * @param[in] stc The stc handle
83 * @param[out] rule The reset rule handle
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
96 * @see #stc_reset_rule_h
97 * @see stc_initialize()
98 * @see stc_reset_rule_destroy()
100 int stc_reset_rule_create(stc_h stc, stc_reset_rule_h *rule);
103 * @brief Destroys the reset rule handle.
105 * @privlevel platform
106 * @privilege %http://tizen.org/privilege/network.get
108 * @param[in] rule The reset rule handle
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
120 * @see #stc_reset_rule_h
121 * @see stc_reset_rule_create()
123 int stc_reset_rule_destroy(stc_reset_rule_h rule);
126 * @brief Sets the application ID for reset rule.
128 * @privlevel platform
129 * @privilege %http://tizen.org/privilege/network.get
131 * @param[in] rule The reset rule handle
132 * @param[in] app_id The application ID
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
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()
149 int stc_reset_rule_set_app_id(stc_reset_rule_h rule, const char *app_id);
152 * @brief Sets the subscriber ID for reset rule.
154 * @privlevel platform
155 * @privilege %http://tizen.org/privilege/network.get
157 * @param[in] rule The reset rule handle
158 * @param[in] subscriber_id The subscriber ID
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
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()
175 int stc_reset_rule_set_subscriber_id(stc_reset_rule_h rule, const char *subscriber_id);
178 * @brief Sets the interface type for reset rule.
180 * @privlevel platform
181 * @privilege %http://tizen.org/privilege/network.get
183 * @param[in] rule The reset rule handle
184 * @param[in] iface_type The interface type
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
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()
202 int stc_reset_rule_set_iface_type(stc_reset_rule_h rule,
203 stc_iface_type_e iface_type);
206 * @brief Sets the time interval for reset rule.
208 * @privlevel platform
209 * @privilege %http://tizen.org/privilege/network.get
211 * @param[in] rule The reset rule handle
212 * @param[in] from The time interval from
213 * @param[in] to The time interval to
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
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()
230 int stc_reset_rule_set_time_interval(stc_reset_rule_h rule,
231 time_t from, time_t to);
234 * @brief Gets the application ID for reset.
236 * @privlevel platform
237 * @privilege %http://tizen.org/privilege/network.get
239 * @param[in] rule The reset rule handle
240 * @param[out] app_id The application ID
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
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()
257 int stc_reset_rule_get_app_id(stc_reset_rule_h rule, char **app_id);
260 * @brief Gets the subscriber ID for reset rule.
262 * @privlevel platform
263 * @privilege %http://tizen.org/privilege/network.get
265 * @param[in] rule The reset rule handle
266 * @param[out] subscriber_id The subscriber ID
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
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()
283 int stc_reset_rule_get_subscriber_id(stc_reset_rule_h rule, char **subscriber_id);
286 * @brief Gets the interface type for reset rule.
288 * @privlevel platform
289 * @privilege %http://tizen.org/privilege/network.get
291 * @param[in] rule The reset rule handle
292 * @param[out] iface_type The interface type
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
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()
310 int stc_reset_rule_get_iface_type(stc_reset_rule_h rule,
311 stc_iface_type_e *iface_type);
314 * @brief Gets the time interval for reset rule.
316 * @privlevel platform
317 * @privilege %http://tizen.org/privilege/network.get
319 * @param[in] rule The reset rule handle
320 * @param[out] from The time interval from
321 * @param[out] to The time interval to
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
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()
338 int stc_reset_rule_get_time_interval(stc_reset_rule_h rule,
339 time_t *from, time_t *to);
342 * @brief Gets the subscriber ID from statistics information.
344 * @remarks You must release @a subscriber ID using free().
346 * @param[in] info The statistics information handle
347 * @param[out] subscriber_id The subscriber ID
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
359 * @see stc_stats_info_h
360 * @see stc_stats_info_cb()
362 int stc_stats_info_get_subscriber_id(stc_stats_info_h info, char **subscriber_id);
372 #endif /* __TIZEN_STC_STAT_INTERNAL_H__ */