summaryrefslogtreecommitdiffstats
path: root/src/expr/counter.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/expr/counter.c')
-rw-r--r--src/expr/counter.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/src/expr/counter.c b/src/expr/counter.c
index 21901e8..2036cb0 100644
--- a/src/expr/counter.c
+++ b/src/expr/counter.c
@@ -115,42 +115,6 @@ nftnl_expr_counter_parse(struct nftnl_expr *e, struct nlattr *attr)
return 0;
}
-static int
-nftnl_expr_counter_json_parse(struct nftnl_expr *e, json_t *root,
- struct nftnl_parse_err *err)
-{
-#ifdef JSON_PARSING
- uint64_t uval64;
-
- if (nftnl_jansson_parse_val(root, "pkts", NFTNL_TYPE_U64, &uval64,
- err) == 0)
- nftnl_expr_set_u64(e, NFTNL_EXPR_CTR_PACKETS, uval64);
-
- if (nftnl_jansson_parse_val(root, "bytes", NFTNL_TYPE_U64, &uval64,
- err) == 0)
- nftnl_expr_set_u64(e, NFTNL_EXPR_CTR_BYTES, uval64);
-
- return 0;
-#else
- errno = EOPNOTSUPP;
- return -1;
-#endif
-}
-
-static int nftnl_expr_counter_export(char *buf, size_t size,
- const struct nftnl_expr *e, int type)
-{
- struct nftnl_expr_counter *ctr = nftnl_expr_data(e);
- NFTNL_BUF_INIT(b, buf, size);
-
- if (e->flags & (1 << NFTNL_EXPR_CTR_PACKETS))
- nftnl_buf_u64(&b, type, ctr->pkts, PKTS);
- if (e->flags & (1 << NFTNL_EXPR_CTR_BYTES))
- nftnl_buf_u64(&b, type, ctr->bytes, BYTES);
-
- return nftnl_buf_done(&b);
-}
-
static int nftnl_expr_counter_snprintf_default(char *buf, size_t len,
const struct nftnl_expr *e)
{
@@ -169,7 +133,6 @@ static int nftnl_expr_counter_snprintf(char *buf, size_t len, uint32_t type,
return nftnl_expr_counter_snprintf_default(buf, len, e);
case NFTNL_OUTPUT_XML:
case NFTNL_OUTPUT_JSON:
- return nftnl_expr_counter_export(buf, len, e, type);
default:
break;
}
@@ -201,5 +164,4 @@ struct expr_ops expr_ops_counter = {
.parse = nftnl_expr_counter_parse,
.build = nftnl_expr_counter_build,
.snprintf = nftnl_expr_counter_snprintf,
- .json_parse = nftnl_expr_counter_json_parse,
};