Replaced imsi to subscriber ID
[platform/core/connectivity/stc-manager.git] / src / database / include / table-restrictions.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_RESTRICTIONS_H__
18 #define __TABLE_RESTRICTIONS_H__
19
20 typedef struct {
21         char *app_id;
22         char *ifname;
23         char *subscriber_id;
24         stc_iface_type_e iftype;
25         stc_restriction_state_e rst_state;
26         stc_roaming_type_e roaming;
27         int64_t data_limit;
28         int64_t data_warn_limit;
29         uint64_t restriction_id;
30 } table_restrictions_info;
31
32 typedef stc_cb_ret_e
33 (*table_restrictions_info_cb)(const table_restrictions_info *info,
34                               void *user_data);
35
36 stc_error_e table_restrictions_foreach(table_restrictions_info_cb info_cb,
37                                        void *user_data);
38
39 stc_error_e table_restrictions_per_app(const gchar *app_id,
40                                        table_restrictions_info_cb info_cb,
41                                        void *user_data);
42
43
44 stc_error_e table_restrictions_get_restriction_state_subscriber_id(const char *app_id,
45                                                           stc_iface_type_e iftype,
46                                                           const char *subscriber_id,
47                                                           stc_restriction_state_e *state);
48
49 stc_error_e table_restrictions_get_restriction_state(const char *app_id,
50                                                      stc_iface_type_e iftype,
51                                                      stc_restriction_state_e *state);
52
53 stc_error_e table_restrictions_update(table_restrictions_info *info);
54
55 stc_error_e table_restrictions_delete(const char *app_id,
56                                       const stc_iface_type_e iftype,
57                                       const char *subscriber_id);
58
59 stc_error_e table_restrictions_prepare(sqlite3 *db);
60
61 void table_restrictions_finalize(void);
62
63 #endif /*__TABLE_RESTRICTIONS_H__ */