{ "help", 0, 0, 'h' },
{ "noflush", 0, 0, 'n'},
{ "modprobe", 1, 0, 'M'},
+ { "table", 1, 0, 'T'},
{ 0 }
};
" [ --test ]\n"
" [ --help ]\n"
" [ --noflush ]\n"
+ " [ --table=<TABLE> ]\n"
" [ --modprobe=<command>]\n", name);
exit(1);
FILE *in;
const char *modprobe = 0;
int in_table = 0, testing = 0;
+ const char *tablename = 0;
program_name = "iptables-restore";
program_version = IPTABLES_VERSION;
init_extensions();
#endif
- while ((c = getopt_long(argc, argv, "bcvthnM:", options, NULL)) != -1) {
+ while ((c = getopt_long(argc, argv, "bcvthnM:T:", options, NULL)) != -1) {
switch (c) {
case 'b':
binary = 1;
case 'M':
modprobe = optarg;
break;
+ case 'T':
+ tablename = optarg;
+ break;
}
}
strncpy(curtable, table, IPT_TABLE_MAXNAMELEN);
curtable[IPT_TABLE_MAXNAMELEN] = '\0';
+ if (tablename && (strcmp(tablename, table) != 0))
+ continue;
if (handle)
iptc_free(&handle);
free_argv();
}
+ if (tablename && (strcmp(tablename, curtable) != 0))
+ continue;
if (!ret) {
fprintf(stderr, "%s: line %u failed\n",
program_name, line);