Tomato 1.24
[tomato.git] / release / src / router / iptables / iptables-multi.c
blobbd2c58bd0108ba5c466c48f4ab21c442c0f720dc
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <libgen.h>
6 int iptables_main(int argc, char **argv);
7 int iptables_save_main(int argc, char **argv);
8 int iptables_restore_main(int argc, char **argv);
10 int main(int argc, char **argv) {
11 char *progname;
13 if (argc == 0) {
14 fprintf(stderr, "no argv[0]?");
15 exit(1);
16 } else {
17 progname = basename(argv[0]);
19 if (!strcmp(progname, "iptables"))
20 return iptables_main(argc, argv);
21 #ifdef IPTABLES_SAVE
22 if (!strcmp(progname, "iptables-save"))
23 return iptables_save_main(argc, argv);
24 #endif
25 if (!strcmp(progname, "iptables-restore"))
26 return iptables_restore_main(argc, argv);
28 fprintf(stderr, "iptables multi-purpose version: unknown applet name %s\n", progname);
29 exit(1);