diff options
author | /C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net </C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net> | 2007-10-31 11:48:04 +0000 |
---|---|---|
committer | /C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net </C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net> | 2007-10-31 11:48:04 +0000 |
commit | c559e40ff4ce556a6840f7264798cf723c628d06 (patch) | |
tree | a9f3de9f213eb3ec927fda4ec221310fd3a38e2f /ip6tables-multi.c | |
parent | 7ed652e2148f70c8f81a22676f8538d958cb67f2 (diff) |
[PATCH] 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>
Diffstat (limited to 'ip6tables-multi.c')
-rw-r--r-- | ip6tables-multi.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/ip6tables-multi.c b/ip6tables-multi.c new file mode 100644 index 0000000..0bcface --- /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); + } +} |