const struct fw3_option fw3_forward_opts[] = {
+ FW3_OPT("enabled", bool, forward, enabled),
+
FW3_OPT("name", string, forward, name),
FW3_OPT("family", family, forward, family),
memset(forward, 0, sizeof(*forward));
+ forward->enabled = true;
+
fw3_parse_options(forward, fw3_forward_opts, s);
+ if (!forward->enabled)
+ {
+ fw3_free_forward(forward);
+ continue;
+ }
+
if (forward->src.invert || forward->dest.invert)
{
warn_elem(e, "must not have inverted 'src' or 'dest' options");
const struct fw3_option fw3_include_opts[] = {
+ FW3_OPT("enabled", bool, include, enabled),
+
FW3_OPT("path", string, include, path),
FW3_OPT("type", include_type, include, type),
FW3_OPT("family", family, include, family),
continue;
memset(include, 0, sizeof(*include));
+
include->name = e->name;
+ include->enabled = true;
fw3_parse_options(include, fw3_include_opts, s);
+ if (!include->enabled)
+ {
+ fw3_free_include(include);
+ continue;
+ }
+
if (!include->path)
{
warn_elem(e, "must specify a path");
const struct fw3_option fw3_ipset_opts[] = {
+ FW3_OPT("enabled", bool, ipset, enabled),
+
FW3_OPT("name", string, ipset, name),
FW3_OPT("family", family, ipset, family),
struct list_head list;
struct list_head running_list;
+ bool enabled;
const char *name;
enum fw3_family family;
{
struct list_head list;
+ bool enabled;
const char *name;
enum fw3_family family;
{
struct list_head list;
+ bool enabled;
const char *name;
enum fw3_family family;
{
struct list_head list;
+ bool enabled;
const char *name;
enum fw3_family family;
struct list_head list;
struct list_head running_list;
+ bool enabled;
const char *name;
enum fw3_family family;
struct list_head list;
struct list_head running_list;
+ bool enabled;
const char *name;
enum fw3_family family;
const struct fw3_option fw3_redirect_opts[] = {
+ FW3_OPT("enabled", bool, redirect, enabled),
+
FW3_OPT("name", string, redirect, name),
FW3_OPT("family", family, redirect, family),
INIT_LIST_HEAD(&redir->proto);
INIT_LIST_HEAD(&redir->mac_src);
+ redir->enabled = true;
redir->reflection = true;
fw3_parse_options(redir, fw3_redirect_opts, s);
+ if (!redir->enabled)
+ {
+ fw3_free_redirect(redir);
+ continue;
+ }
+
if (redir->src.invert)
{
warn_elem(e, "must not have an inverted source");
const struct fw3_option fw3_rule_opts[] = {
+ FW3_OPT("enabled", bool, rule, enabled),
+
FW3_OPT("name", string, rule, name),
FW3_OPT("family", family, rule, family),
INIT_LIST_HEAD(&rule->icmp_type);
+ rule->enabled = true;
+
fw3_parse_options(rule, fw3_rule_opts, s);
+ if (!rule->enabled)
+ {
+ fw3_free_rule(rule);
+ continue;
+ }
+
if (rule->src.invert || rule->dest.invert)
{
warn_elem(e, "must not have inverted 'src' or 'dest' options");
};
const struct fw3_option fw3_zone_opts[] = {
+ FW3_OPT("enabled", bool, zone, enabled),
+
FW3_OPT("name", string, zone, name),
FW3_OPT("family", family, zone, family),
INIT_LIST_HEAD(&zone->masq_src);
INIT_LIST_HEAD(&zone->masq_dest);
+ zone->enabled = true;
zone->log_limit.rate = 10;
return zone;
fw3_parse_options(zone, fw3_zone_opts, s);
+ if (!zone->enabled)
+ {
+ fw3_free_zone(zone);
+ continue;
+ }
+
if (!zone->extra_dest)
zone->extra_dest = zone->extra_src;