]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
ebtables: Pass struct iptables_command_state to print_help()
authorPhil Sutter <phil@nwl.cc>
Fri, 24 Nov 2023 18:14:23 +0000 (19:14 +0100)
committerPhil Sutter <phil@nwl.cc>
Tue, 5 Dec 2023 15:35:37 +0000 (16:35 +0100)
Parameters passed by the sole caller came from there already, apart from
'table' which is not used (ebtables-nft does not have per-table help
texts).

Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/xtables-eb.c

index 9afaa614bac5b4a291009292dc579b44ec8b3756..017e1ad3648402cff166743811ea01f4f0b27bac 100644 (file)
@@ -303,9 +303,11 @@ static struct option *merge_options(struct option *oldopts,
        return merge;
 }
 
-static void print_help(const struct xtables_target *t,
-                      const struct xtables_rule_match *m, const char *table)
+static void print_help(struct iptables_command_state *cs)
 {
+       const struct xtables_rule_match *m = cs->matches;
+       struct xtables_target *t = cs->target;
+
        printf("%s %s\n", prog_name, prog_vers);
        printf(
 "Usage:\n"
@@ -354,9 +356,6 @@ static void print_help(const struct xtables_target *t,
                printf("\n");
                t->help();
        }
-
-//     if (table->help)
-//             table->help(ebt_hooknames);
 }
 
 /* Execute command L */
@@ -1144,7 +1143,7 @@ print_zero:
                ebt_print_error2("Bad table name");*/
 
        if (command == 'h' && !(flags & OPT_ZERO)) {
-               print_help(cs.target, cs.matches, *table);
+               print_help(&cs);
                ret = 1;
        }