2 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __STC_HELPER_FIREWALL_H__
18 #define __STC_HELPER_FIREWALL_H__
20 #include <arpa/inet.h>
22 #include "stc-manager.h"
23 #include "stc-error.h"
25 #define FIREWALL_CHAIN_TARGET_IN "STC_IN"
26 #define FIREWALL_CHAIN_TARGET_OUT "STC_OUT"
28 #define FIREWALL_RULE_TARGET_ACCEPT "ACCEPT"
29 #define FIREWALL_RULE_TARGET_DROP "DROP"
30 #define FIREWALL_RULE_TARGET_LOG "LOG"
45 stc_fw_chain_target_e target;
52 stc_fw_direction_e direction;
53 stc_fw_ip_type_e s_ip_type;
54 stc_fw_ip_type_e d_ip_type;
55 stc_fw_port_type_e s_port_type;
56 stc_fw_port_type_e d_port_type;
57 stc_fw_protocol_type_e protocol;
58 stc_fw_family_type_e family;
68 stc_fw_rule_target_e target;
73 stc_error_e firewall_chain_add(firewall_chain_s *chain);
74 stc_error_e firewall_chain_remove(firewall_chain_s *chain);
75 stc_error_e firewall_chain_flush(firewall_chain_s *chain);
76 stc_error_e firewall_chain_set(firewall_chain_s *chain);
77 stc_error_e firewall_chain_unset(firewall_chain_s *chain);
79 stc_error_e firewall_rule_add(firewall_rule_s *rule);
80 stc_error_e firewall_rule_remove(firewall_rule_s *rule);
82 #endif /*__STC_HELPER_FIREWALL_H__*/