2 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
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 __TABLE_STATISTICS_H__
18 #define __TABLE_STATISTICS_H__
24 stc_iface_type_e iftype;
25 stc_db_tm_interval_s *interval;
26 stc_data_counter_s cnt;
27 stc_roaming_type_e roaming;
28 stc_hw_net_protocol_type_e hw_net_protocol_type;
29 stc_app_state_e ground;
30 } table_statistics_info;
35 stc_iface_type_e iftype;
36 stc_db_tm_interval_s *interval;
37 } table_statistics_reset_rule;
42 stc_iface_type_e iftype;
44 } table_statistics_select_rule;
47 (*table_statistics_info_cb)(const table_statistics_info *info, void *user_data);
49 stc_error_e table_statistics_reset_first_n_entries(int num);
51 stc_error_e table_statistics_reset(const table_statistics_reset_rule *rule);
53 stc_error_e table_statistics_foreach_app(const table_statistics_select_rule *rule,
54 table_statistics_info_cb info_cb,
57 stc_error_e table_statistics_per_app(const char *app_id,
58 table_statistics_select_rule *rule,
59 table_statistics_info_cb info_cb,
62 stc_error_e table_statistics_insert(stc_db_classid_iftype_key *stat_key,
63 stc_db_app_stats *stat,
64 time_t last_touch_time);
66 stc_error_e table_statistics_prepare(sqlite3 *db);
68 void table_statistics_finalize(void);
70 #endif /*__TABLE_STATISTICS_H__ */