From: Jo-Philipp Wich Date: Thu, 16 May 2013 19:26:56 +0000 (+0200) Subject: Rename struct fw3_rule_spec to struct fw3_chain_spec and move the declaration to... X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f12271d15da3796c558b6649e97dad988ae2c057;p=oweals%2Ffirewall3.git Rename struct fw3_rule_spec to struct fw3_chain_spec and move the declaration to options.h --- diff --git a/defaults.c b/defaults.c index 3ed6cfa..d1c5e2c 100644 --- a/defaults.c +++ b/defaults.c @@ -22,7 +22,7 @@ #define C(f, tbl, def, fmt) \ { FW3_FAMILY_##f, FW3_TABLE_##tbl, FW3_FLAG_##def, fmt } -static const struct fw3_rule_spec default_chains[] = { +static const struct fw3_chain_spec default_chains[] = { C(ANY, FILTER, UNSPEC, "delegate_input"), C(ANY, FILTER, UNSPEC, "delegate_output"), C(ANY, FILTER, UNSPEC, "delegate_forward"), @@ -130,7 +130,7 @@ fw3_print_default_chains(struct fw3_ipt_handle *handle, struct fw3_state *state, bool reload) { struct fw3_defaults *defs = &state->defaults; - const struct fw3_rule_spec *c; + const struct fw3_chain_spec *c; #define policy(t) \ ((t == FW3_FLAG_REJECT) ? FW3_FLAG_DROP : t) @@ -392,7 +392,7 @@ fw3_flush_rules(struct fw3_ipt_handle *handle, struct fw3_state *state, { enum fw3_flag policy = reload ? FW3_FLAG_DROP : FW3_FLAG_ACCEPT; struct fw3_defaults *defs = &state->defaults; - const struct fw3_rule_spec *c; + const struct fw3_chain_spec *c; if (!has(defs->flags, handle->family, handle->table)) return; diff --git a/options.h b/options.h index e903ab3..004eeee 100644 --- a/options.h +++ b/options.h @@ -456,6 +456,13 @@ struct fw3_state bool statefile; }; +struct fw3_chain_spec { + int family; + int table; + int flag; + const char *format; +}; + struct fw3_option { diff --git a/utils.h b/utils.h index 42dac73..0d1b9d8 100644 --- a/utils.h +++ b/utils.h @@ -91,14 +91,6 @@ void fw3_write_statefile(void *state); void fw3_free_object(void *obj, const void *opts); - -struct fw3_rule_spec { - int family; - int table; - int flag; - const char *format; -}; - bool fw3_hotplug(bool add, void *zone, void *device); #endif diff --git a/zones.c b/zones.c index 11ec569..979d150 100644 --- a/zones.c +++ b/zones.c @@ -23,7 +23,7 @@ #define C(f, tbl, tgt, fmt) \ { FW3_FAMILY_##f, FW3_TABLE_##tbl, FW3_FLAG_##tgt, fmt } -static const struct fw3_rule_spec zone_chains[] = { +static const struct fw3_chain_spec zone_chains[] = { C(ANY, FILTER, UNSPEC, "zone_%s_input"), C(ANY, FILTER, UNSPEC, "zone_%s_output"), C(ANY, FILTER, UNSPEC, "zone_%s_forward"), @@ -232,7 +232,7 @@ print_zone_chain(struct fw3_ipt_handle *handle, struct fw3_state *state, { int i; struct fw3_ipt_rule *r; - const struct fw3_rule_spec *c; + const struct fw3_chain_spec *c; const char *flt_chains[] = { "input", "input", @@ -563,7 +563,7 @@ fw3_flush_zones(struct fw3_ipt_handle *handle, struct fw3_state *state, bool reload) { struct fw3_zone *z, *tmp; - const struct fw3_rule_spec *c; + const struct fw3_chain_spec *c; char chain[32]; list_for_each_entry_safe(z, tmp, &state->zones, list)