Added firewall feature
[platform/core/connectivity/stc-manager.git] / src / database / include / table-firewall.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_FIREWALL_H__
18 #define __TABLE_FIREWALL_H__
19
20 #include <arpa/inet.h>
21 #include "helper-firewall.h"
22
23 typedef stc_cb_ret_e
24 (*firewall_chain_cb)(const firewall_chain_s *info, void *user_data);
25
26 typedef stc_cb_ret_e
27 (*firewall_rule_cb)(const firewall_rule_s *info, void *user_data);
28
29 stc_error_e table_firewall_insert_lock(char *name, int state);
30 stc_error_e table_firewall_update_lock(char *name, int state);
31 stc_error_e table_firewall_get_lock(char *name, int *state);
32
33 stc_error_e table_firewall_insert_chain(firewall_chain_s *info);
34 stc_error_e table_firewall_delete_chain(firewall_chain_s *info);
35 stc_error_e table_firewall_flush_chain(firewall_chain_s *info);
36 stc_error_e table_firewall_update_chain(firewall_chain_s *info);
37 stc_error_e table_firewall_foreach_chain(firewall_chain_cb info_cb,
38                                        void *user_data);
39
40 stc_error_e table_firewall_insert_rule(firewall_rule_s *info);
41 stc_error_e table_firewall_delete_rule(firewall_rule_s *info);
42 stc_error_e table_firewall_update_rule(firewall_rule_s *info);
43 stc_error_e table_firewall_foreach_rule(firewall_rule_cb info_cb,
44                                        void *user_data);
45
46 stc_error_e table_firewall_prepare(sqlite3 *db);
47 void table_firewall_finalize(void);
48
49 #endif /*__TABLE_FIREWALL_H__ */