Rename struct fw3_rule_spec to struct fw3_chain_spec and move the declaration to...
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 16 May 2013 19:26:56 +0000 (21:26 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Fri, 17 May 2013 12:36:34 +0000 (14:36 +0200)
defaults.c
options.h
utils.h
zones.c

index 3ed6cfaad9b62615149f1b441e7c19d8e115dd88..d1c5e2c059e8d2e863ff0c2b074cc323d1a784f2 100644 (file)
@@ -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;
index e903ab3ffe972365a81446b5738ccc5d6df9857a..004eeeee1f8d63c8ff98b6dcbf712c242c978cbd 100644 (file)
--- 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 42dac7333541c31a3acb002fe087eed8e92c3630..0d1b9d836a56b6f194d3cbd0ed8f72fb8ddb6e06 100644 (file)
--- 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 11ec56979aaceec7c1f1d43c332bf65724d5651e..979d150e56080719c67da43ef2029fc158c86c80 100644 (file)
--- 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)