Add some chains to separate monitoring and restriction
[platform/core/connectivity/stc-manager.git] / src / monitor / include / stc-monitor.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 __STC_MONITOR_H__
18 #define __STC_MONITOR_H__
19
20 #include <glib.h>
21 #include "stc-error.h"
22 #include "stc-manager.h"
23 #include "stc-manager-util.h"
24 #include "stc-monitor-context.h"
25 #include "stc-monitor-app.h"
26 #include "stc-monitor-proc.h"
27 #include "stc-monitor-rstn.h"
28 #include "helper-nl.h"
29
30 /* 1 seconds */
31 #define CONTR_TIMER_INTERVAL 1
32
33 #ifndef VCONFKEY_STC_BACKGROUND_STATE
34 #define VCONFKEY_STC_BACKGROUND_STATE "db/stc/background_state"
35 #endif
36
37 #ifndef VCONFKEY_SETAPPL_DATA_RESTRICTION_INT
38 #define VCONFKEY_SETAPPL_DATA_RESTRICTION_INT "db/setting/data_restriction"
39 #endif
40
41 /**
42  * @brief initializes stc monitor module
43  */
44 stc_error_e stc_monitor_init(void);
45
46 /**
47  * @brief deinitializes stc monitor module
48  */
49 stc_error_e stc_monitor_deinit(void);
50
51 GHashTable *stc_monitor_get_system_apps(void);
52
53 GHashTable *stc_monitor_get_system_rstns(void);
54
55 int stc_monitor_get_contr_sock(void);
56
57 time_t stc_monitor_get_last_month_ts(void);
58
59 void stc_monitor_set_last_month_ts(time_t time);
60
61 time_t stc_monitor_get_last_week_ts(void);
62
63 void stc_monitor_set_last_week_ts(time_t time);
64
65 time_t stc_monitor_get_last_day_ts(void);
66
67 void stc_monitor_set_last_day_ts(time_t time);
68
69 void stc_monitor_set_rstns_updated(gboolean value);
70
71 gboolean stc_monitor_get_rstns_updated(void);
72
73 void stc_monitor_set_apps_updated(gboolean value);
74
75 gboolean stc_monitor_get_apps_updated(void);
76
77 void stc_monitor_set_background_state(gboolean value);
78
79 gboolean stc_monitor_get_background_state(void);
80
81 void stc_monitor_update_by_default_connection(void *data);
82
83 stc_error_e stc_monitor_check_excn_by_cmdline(char *cmdline);
84
85 #endif /* __STC_MONITOR_H__ */