tizen 2.3.1 release
[kernel/api/system-resource.git] / src / network / include / datausage-quota-processing.h
1 /*
2  * resourced
3  *
4  * Copyright (c) 2000 - 2013 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 /*
21  *  @file: datausage-quota-processing.h
22  *
23  *  @desc Entity for working with quotas
24  *  @version 2.0
25  *
26  *  Created on: Aug 08, 2012
27  */
28
29 #ifndef _TRESOURCED_DATAUSAGE_QUOTA_PROCESSING_H_
30 #define _TRESOURCED_DATAUSAGE_QUOTA_PROCESSING_H_
31
32 #include <sqlite3.h>
33
34 #include "app-stat.h"
35 #include "resourced.h"
36
37 /*
38  * Store data in effective quota
39  */
40 void flush_quota_table(void);
41
42 /*
43  * Quota processing. It's apply quota if needed.
44  * And actualize current quotas state.
45  */
46 resourced_ret_c process_quota(struct application_stat_tree *apps,
47         volatile struct daemon_opts *opts);
48
49 /*
50  * Finish working with quotas
51  */
52 void finalize_quotas(void);
53
54 /*
55  * Delete quota and drop remove restriction
56  */
57 void update_quota_state(const char *app_id, const resourced_iface_type iftype,
58         const time_t start_time, const int time_period,
59         const resourced_roaming_type roaming);
60
61 #endif /* _TRESOURCED_DATAUSAGE_QUOTA_PROCESSING_H_ */