1#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 return ip6tables_main(argc, argv); 21 22#ifdef IPTABLES_SAVE 23 if (!strcmp(progname, "ip6tables-save")) 24 return ip6tables_save_main(argc, argv); 25#endif 26 27 if (!strcmp(progname, "ip6tables-restore")) 28 return ip6tables_restore_main(argc, argv); 29 30 fprintf(stderr, "ip6tables multi-purpose version: unknown applet name %s\n", progname); 31 exit(1); 32 } 33} 34