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

@@ -57,17 +57,6 @@ static void gradm_mt_check(unsigned int flags)
{
}
static void gradm_mt_print(const void *ip, const struct xt_entry_match *match,
int numeric)
{
const struct xt_gradm_mtinfo *info = (const void *)match->data;
if (info->invflags)
printf("gradm: disabled");
else
printf("gradm: enabled");
}
static void gradm_mt_save(const void *ip, const struct xt_entry_match *match)
{
const struct xt_gradm_mtinfo *info = (const void *)match->data;
@@ -78,6 +67,13 @@ static void gradm_mt_save(const void *ip, const struct xt_entry_match *match)
printf(" --enabled ");
}
static void gradm_mt_print(const void *ip, const struct xt_entry_match *match,
int numeric)
{
printf(" -m gradm");
gradm_mt_save(ip, match);
}
static struct xtables_match gradm_mt_reg = {
.family = NFPROTO_UNSPEC,
.name = "gradm",