summaryrefslogtreecommitdiffstats
path: root/iptables.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2009-06-12 20:48:52 +0200
committerJan Engelhardt <jengelh@medozas.de>2009-06-26 21:13:10 +0200
commitf89c1716a7743ca6e2e6164d3b64c15b2e285e1e (patch)
treecaaa6a6d656085690a71b791108c6a78365fe8dd /iptables.c
parent92edcb0cf517ddb7976e396eabc7a79f8a1016ba (diff)
iptables: allow for help-less extensions
This is for extensions that do not take any options, and which subsequently do not offer any help text either. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'iptables.c')
-rw-r--r--iptables.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/iptables.c b/iptables.c
index cc175767..a229c35b 100644
--- a/iptables.c
+++ b/iptables.c
@@ -40,6 +40,7 @@
#include <xtables.h>
#include <fcntl.h>
#include <sys/utsname.h>
+#include "xshared.h"
#ifndef TRUE
#define TRUE 1
@@ -248,9 +249,6 @@ exit_tryhelp(int status)
static void
exit_printhelp(struct xtables_rule_match *matches)
{
- struct xtables_rule_match *matchp = NULL;
- struct xtables_target *t = NULL;
-
printf("%s v%s\n\n"
"Usage: %s -[AD] chain rule-specification [options]\n"
" %s -I chain [rulenum] rule-specification [options]\n"
@@ -320,19 +318,7 @@ exit_printhelp(struct xtables_rule_match *matches)
" --set-counters PKTS BYTES set the counter during insert/append\n"
"[!] --version -V print package version.\n");
- /* Print out any special helps. A user might like to be able
- to add a --help to the commandline, and see expected
- results. So we call help for all specified matches & targets */
- for (t = xtables_targets; t ;t = t->next) {
- if (t->used) {
- printf("\n");
- t->help();
- }
- }
- for (matchp = matches; matchp; matchp = matchp->next) {
- printf("\n");
- matchp->match->help();
- }
+ print_extension_helps(xtables_targets, matches);
exit(0);
}