2 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 * Manage ip6tables rule using libip6tc
21 #ifndef __STC_HELPER_IP6TABLES_H__
22 #define __STC_HELPER_IP6TABLES_H__
24 #include <libiptc/libip6tc.h>
29 IP6TABLES_CHAIN_INPUT,
30 IP6TABLES_CHAIN_OUTPUT
36 } ip6tables_rule_type_e;
39 IP6TABLES_ACTION_ACCEPT,
41 } ip6tables_target_action_e;
45 ip6tables_rule_type_e type;
53 * @desc This function adds a new ip6tables rule.
54 * @return 0 on success and negative value if error.
56 int ip6tables_add_rule(ip6tables_rule_s *rule);
59 * @desc This function removes already set ip6tables rule.
60 * @return 0 on success and negative value if error.
62 int ip6tables_remove_rule(ip6tables_rule_s *rule);
65 * @desc This function adds a new ip6tables chain.
66 * @return 0 on success and negative value if error.
68 int ip6tables_add_chain(const char *chain);
71 * @desc This function removes already set ip6tables chain.
72 * @return 0 on success and negative value if error.
74 int ip6tables_remove_chain(const char *chain);
77 * @desc This function flushes all ip6tables rules in chain.
78 * @return 0 on success and negative value if error.
80 int ip6tables_flush_chain(const char *chain);
82 #endif /*__STC_HELPER_IP6TABLES_H__*/