extensions: make print (iptables -L) output the same as save (-S)

This commit is contained in:
Jan Engelhardt
2013-05-30 17:16:56 +02:00
parent 6a60b5ab75
commit 13db8d78c9
21 changed files with 150 additions and 331 deletions

View File

@@ -62,15 +62,6 @@ static void condition_check(unsigned int flags)
"Condition match: must specify --condition");
}
static void condition_print(const void *ip, const struct xt_entry_match *match,
int numeric)
{
const struct xt_condition_mtinfo *info = (const void *)match->data;
printf(" condition %s%s ", (info->invert) ? "!" : "", info->name);
}
static void condition_save(const void *ip, const struct xt_entry_match *match)
{
const struct xt_condition_mtinfo *info = (const void *)match->data;
@@ -78,6 +69,13 @@ static void condition_save(const void *ip, const struct xt_entry_match *match)
printf("%s --condition \"%s\" ", info->invert ? " !" : "", info->name);
}
static void condition_print(const void *ip, const struct xt_entry_match *match,
int numeric)
{
printf(" -m condition");
condition_save(ip, match);
}
static struct xtables_match condition_mt_reg = {
.name = "condition",
.revision = 1,