[STC Manager] Support set/get for total data usage(Tx + Rx) in restriction.
[platform/core/connectivity/stc-manager.git] / src / database / include / table-counters.h
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
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 __TABLE_COUNTERS_H__
18 #define __TABLE_COUNTERS_H__
19
20 typedef struct {
21         uint64_t restriction_id;
22         int64_t data_counter;
23 } table_counters_info;
24
25 typedef stc_cb_ret_e(*table_counters_info_cb)(const table_counters_info *info,
26                                               void *user_data);
27
28 stc_error_e table_counters_get(uint64_t restriction_id,
29                                table_counters_info *info);
30
31 stc_error_e table_counters_update_counters(const table_counters_info *info);
32
33 stc_error_e table_counters_insert(const table_counters_info *info);
34
35 stc_error_e table_counters_delete(uint64_t restriction_id);
36
37 stc_error_e table_counters_prepare(sqlite3 *db);
38
39 void table_counters_finalize(void);
40
41 #endif /*__TABLE_COUNTERS_H__ */