1
0
This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
TP-Link_Archer-XR500v/EN7526G_3.18Kernel_SDK/apps/public/iptables-1.4.10/ip6tables-multi.c
2024-07-22 01:58:46 -03:00

46 lines
1.1 KiB
C
Executable File

#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 < 1) {
fprintf(stderr, "ERROR: This should not happen.\n");
exit(EXIT_FAILURE);
}
progname = basename(argv[0]);
if (strcmp(progname, "ip6tables") == 0)
return ip6tables_main(argc, argv);
if (strcmp(progname, "ip6tables-save") == 0)
return ip6tables_save_main(argc, argv);
if (strcmp(progname, "ip6tables-restore") == 0)
return ip6tables_restore_main(argc, argv);
++argv;
--argc;
if (argc < 1) {
fprintf(stderr, "ERROR: No subcommand given.\n");
exit(EXIT_FAILURE);
}
progname = basename(argv[0]);
if (strcmp(progname, "main") == 0)
return ip6tables_main(argc, argv);
if (strcmp(progname, "save") == 0)
return ip6tables_save_main(argc, argv);
if (strcmp(progname, "restore") == 0)
return ip6tables_restore_main(argc, argv);
fprintf(stderr, "ip6tables multi-purpose version: "
"unknown subcommand \"%s\"\n", progname);
exit(EXIT_FAILURE);
}