#include "rules.h"
-static struct fw3_option rule_opts[] = {
+const struct fw3_option fw3_rule_opts[] = {
FW3_OPT("name", string, rule, name),
FW3_OPT("family", family, rule, family),
FW3_OPT("limit_burst", int, rule, limit.burst),
FW3_OPT("target", target, rule, target),
+
+ { }
};
INIT_LIST_HEAD(&rule->icmp_type);
- fw3_parse_options(rule, rule_opts, ARRAY_SIZE(rule_opts), s);
+ fw3_parse_options(rule, fw3_rule_opts, s);
if (rule->src.invert || rule->dest.invert)
{
list_for_each_entry(rule, &state->rules, list)
expand_rule(table, family, rule, num++);
}
-
-void
-fw3_free_rule(struct fw3_rule *rule)
-{
- fw3_free_list(&rule->proto);
-
- fw3_free_list(&rule->ip_src);
- fw3_free_list(&rule->mac_src);
- fw3_free_list(&rule->port_dest);
-
- fw3_free_list(&rule->ip_dest);
- fw3_free_list(&rule->port_dest);
-
- fw3_free_list(&rule->icmp_type);
-
- free(rule);
-}