diff options
author | Álvaro Neira Ayuso <alvaroneay@gmail.com> | 2013-06-27 21:56:18 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-06-29 11:56:05 +0200 |
commit | 4a684c2ee4cdff2c5c6bfa06d93b58cb4e868bf6 (patch) | |
tree | 6216e645631bba685f1c17e0cce851d0c1c6c517 /src/expr/limit.c | |
parent | caf4ac2e95a358f5b6ee64c4cc6c6c96a0bff24b (diff) |
src: support JSON format in chain, rule and expressions
While at it, order possible switch cases of _snprintf.
Signed-off-by: Alvaro Neira Ayuso <alvaroneay@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/expr/limit.c')
-rw-r--r-- | src/expr/limit.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/expr/limit.c b/src/expr/limit.c index d6dc900..1e843ce 100644 --- a/src/expr/limit.c +++ b/src/expr/limit.c @@ -195,6 +195,10 @@ nft_rule_expr_limit_snprintf(char *buf, size_t len, uint32_t type, return snprintf(buf, len, "<rate>%"PRIu64"</rate>" "<depth>%"PRIu64"</depth>", limit->rate, limit->depth); + case NFT_RULE_O_JSON: + return snprintf(buf, len, "\"rate\" : %"PRIu64", " + "\"depth\" : %"PRIu64" ", + limit->rate, limit->depth); default: break; } |