summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHann-Huei Chiou <koala@ascenvision.com>2007-10-31 11:48:04 +0000
committerPatrick McHardy <kaber@trash.net>2007-10-31 11:48:04 +0000
commite8665f8fdd87cd604511e6adcea0cdb0f942ac96 (patch)
treea9f3de9f213eb3ec927fda4ec221310fd3a38e2f
parent3ca9cc6040b72121931bd788c7d45437d5326daf (diff)
let DO_MULTI=1 work for ip6tables* binaries part 2
Sorry forgot to mention that the "ip6tables-multi.c" (in the patch) which is not in the repository has to be manually added. Hann-huei Chiou <koala@ascenvision.com>
-rw-r--r--ip6tables-multi.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/ip6tables-multi.c b/ip6tables-multi.c
new file mode 100644
index 00000000..0bcfaced
--- /dev/null
+++ b/ip6tables-multi.c
@@ -0,0 +1,31 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <libgen.h>
+
+int ip6tables_main(int argc, char **argv);
+int ip6tables_save_main(int argc, char **argv);
+int ip6tables_restore_main(int argc, char **argv);
+
+int main(int argc, char **argv) {
+ char *progname;
+
+ if (argc == 0) {
+ fprintf(stderr, "no argv[0]?");
+ exit(1);
+ } else {
+ progname = basename(argv[0]);
+
+ if (!strcmp(progname, "ip6tables"))
+ return ip6tables_main(argc, argv);
+
+ if (!strcmp(progname, "ip6tables-save"))
+ return ip6tables_save_main(argc, argv);
+
+ if (!strcmp(progname, "ip6tables-restore"))
+ return ip6tables_restore_main(argc, argv);
+
+ fprintf(stderr, "ip6tables multi-purpose version: unknown applet name %s\n", progname);
+ exit(1);
+ }
+}