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;
33 unsigned char version;
36 stc_iface_type_e iftype;
37 stc_db_tm_interval_s *interval;
38 stc_db_connection_period_type connection_state;
39 } table_statistics_reset_rule;
42 unsigned char version;
45 stc_iface_type_e iftype;
47 } table_statistics_select_rule;
50 (*table_statistics_info_cb)(const table_statistics_info *info, void *user_data);
52 stc_error_e table_statistics_reset_first_n_entries(int num);
54 stc_error_e table_statistics_reset(const table_statistics_reset_rule *rule);
56 stc_error_e table_statistics_foreach_app(const table_statistics_select_rule *rule,
57 table_statistics_info_cb info_cb,
60 stc_error_e table_statistics_per_app(const char *app_id,
61 table_statistics_select_rule *rule,
62 table_statistics_info_cb info_cb,
65 stc_error_e table_statistics_insert(stc_db_classid_iftype_key *stat_key,
66 stc_db_app_stats *stat,
67 time_t last_touch_time);
69 stc_error_e table_statistics_prepare(sqlite3 *db);
71 void table_statistics_finalize(void);
73 #endif /*__TABLE_STATISTICS_H__ */