bf36d586c48d20833b80df3d8842ec03c2bc420a
[platform/core/connectivity/stc-manager.git] / plugin / firewall / include / stc-plugin-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 __STC_PLUGIN_FIREWALL_H__
18 #define __STC_PLUGIN_FIREWALL_H__
19
20 #include <glib.h>
21 #include <stdbool.h>
22 #include <unistd.h>
23 #include <string.h>
24 #include <stdlib.h>
25 #include <stdio.h>
26 #include <signal.h>
27 #include <errno.h>
28
29 #include "stc-error.h"
30 #include "stc-manager.h"
31 #include "stc-manager-gdbus.h"
32
33 typedef struct {
34         stc_fw_chain_target_e target;
35         uint64_t priority;
36         GSList *rules;
37 } stc_fw_data_s;
38
39 typedef struct {
40         int (*initialize_plugin) (void);
41         int (*deinitialize_plugin) (void);
42
43         int (*lock_firewall) (void);
44         int (*unlock_firewall) (void);
45         int (*get_lock_firewall) (int *state);
46         int (*update_firewall) (void);
47
48         int (*add_chain) (char *chain);
49         int (*remove_chain) (char *chain);
50         int (*flush_chain) (char *chain);
51         int (*get_all_chain) (GVariantBuilder *builder);
52         int (*set_chain) (char *chain, uint target);
53         int (*unset_chain) (char *chain);
54
55         int (*add_rule) (GVariant *params);
56         int (*remove_rule) (GVariant *params);
57         int (*update_rule) (GVariant *params);
58         int (*get_all_rule) (GVariantBuilder *builder);
59 } stc_plugin_firewall_s;
60
61 #endif /* __STC_PLUGIN_FIREWALL_H__ */