summaryrefslogtreecommitdiff
path: root/xshared.c
diff options
context:
space:
mode:
authorKibum Kim <kb0929.kim@samsung.com>2012-01-07 00:47:33 +0900
committerKibum Kim <kb0929.kim@samsung.com>2012-01-07 00:47:33 +0900
commit8df0096515fc2575560e13982f9edf76bf39555e (patch)
tree0d683bc1583f241ae5675f5fbdccb7260212b35b /xshared.c
parentdbc5ef4889caa206f4d47d83345357780ceef73e (diff)
downloadiptables-8df0096515fc2575560e13982f9edf76bf39555e.tar.gz
iptables-8df0096515fc2575560e13982f9edf76bf39555e.tar.bz2
iptables-8df0096515fc2575560e13982f9edf76bf39555e.zip
Git init
Diffstat (limited to 'xshared.c')
-rw-r--r--xshared.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/xshared.c b/xshared.c
new file mode 100644
index 0000000..21b5b2c
--- /dev/null
+++ b/xshared.c
@@ -0,0 +1,31 @@
+#include <stdio.h>
+#include <xtables.h>
+#include "xshared.h"
+
+/*
+ * 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 and targets.
+ */
+void print_extension_helps(const struct xtables_target *t,
+ const struct xtables_rule_match *m)
+{
+ for (; t != NULL; t = t->next) {
+ if (t->used) {
+ printf("\n");
+ if (t->help == NULL)
+ printf("%s does not take any options\n",
+ t->name);
+ else
+ t->help();
+ }
+ }
+ for (; m != NULL; m = m->next) {
+ printf("\n");
+ if (m->match->help == NULL)
+ printf("%s does not take any options\n",
+ m->match->name);
+ else
+ m->match->help();
+ }
+}