diff options
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/libxt_quota.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/extensions/libxt_quota.c b/extensions/libxt_quota.c index ff7dd2a3..bad77d23 100644 --- a/extensions/libxt_quota.c +++ b/extensions/libxt_quota.c @@ -50,6 +50,17 @@ static void quota_parse(struct xt_option_call *cb) info->flags |= XT_QUOTA_INVERT; } +static int quota_xlate(struct xt_xlate *xl, + const struct xt_xlate_mt_params *params) +{ + const struct xt_quota_info *q = (void *)params->match->data; + + xt_xlate_add(xl, "quota %s%llu bytes", + q->flags & XT_QUOTA_INVERT ? "over " : "", + (unsigned long long) q->quota); + return 1; +} + static struct xtables_match quota_match = { .family = NFPROTO_UNSPEC, .name = "quota", @@ -61,6 +72,7 @@ static struct xtables_match quota_match = { .save = quota_save, .x6_parse = quota_parse, .x6_options = quota_opts, + .xlate = quota_xlate, }; void |