blob: 3313bfdc26afb19a6f7447c5413422e3a3660757 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#include <stdio.h>
2#include <stdlib.h>
3#include <string.h>
4#include <libgen.h>
5
6int ip6tables_main(int argc, char **argv);
7int ip6tables_save_main(int argc, char **argv);
8int ip6tables_restore_main(int argc, char **argv);
9
10int main(int argc, char **argv) {
11 char *progname;
12
13 if (argc == 0) {
14 fprintf(stderr, "no argv[0]?");
15 exit(1);
16 } else {
17 progname = basename(argv[0]);
18
19 if (!strcmp(progname, "ip6tables") ||
20 strcmp(progname, "ip6tables-static") == 0)
21 return ip6tables_main(argc, argv);
22
23 if (!strcmp(progname, "ip6tables-save"))
24 return ip6tables_save_main(argc, argv);
25
26 if (!strcmp(progname, "ip6tables-restore"))
27 return ip6tables_restore_main(argc, argv);
28
29 fprintf(stderr, "ip6tables multi-purpose version: unknown applet name %s\n", progname);
30 exit(1);
31 }
32}