summaryrefslogtreecommitdiffstats
path: root/src/expr/redir.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/expr/redir.c')
-rw-r--r--src/expr/redir.c44
1 files changed, 0 insertions, 44 deletions
diff --git a/src/expr/redir.c b/src/expr/redir.c
index b2aa345..1ed4896 100644
--- a/src/expr/redir.c
+++ b/src/expr/redir.c
@@ -131,48 +131,6 @@ nftnl_expr_redir_parse(struct nftnl_expr *e, struct nlattr *attr)
return 0;
}
-static int
-nftnl_expr_redir_json_parse(struct nftnl_expr *e, json_t *root,
- struct nftnl_parse_err *err)
-{
-#ifdef JSON_PARSING
- uint32_t reg, flags;
-
- if (nftnl_jansson_parse_reg(root, "sreg_proto_min", NFTNL_TYPE_U32,
- &reg, err) == 0)
- nftnl_expr_set_u32(e, NFTNL_EXPR_REDIR_REG_PROTO_MIN, reg);
-
- if (nftnl_jansson_parse_reg(root, "sreg_proto_max", NFTNL_TYPE_U32,
- &reg, err) == 0)
- nftnl_expr_set_u32(e, NFTNL_EXPR_REDIR_REG_PROTO_MAX, reg);
-
- if (nftnl_jansson_parse_val(root, "flags", NFTNL_TYPE_U32, &flags,
- err) == 0)
- nftnl_expr_set_u32(e, NFTNL_EXPR_REDIR_FLAGS, flags);
-
- return 0;
-#else
- errno = EOPNOTSUPP;
- return -1;
-#endif
-}
-
-static int nftnl_expr_redir_export(char *buf, size_t size,
- const struct nftnl_expr *e, int type)
-{
- struct nftnl_expr_redir *redir = nftnl_expr_data(e);
- NFTNL_BUF_INIT(b, buf, size);
-
- if (e->flags & (1 << NFTNL_EXPR_REDIR_REG_PROTO_MIN))
- nftnl_buf_u32(&b, type, redir->sreg_proto_min, SREG_PROTO_MIN);
- if (e->flags & (1 << NFTNL_EXPR_REDIR_REG_PROTO_MAX))
- nftnl_buf_u32(&b, type, redir->sreg_proto_max, SREG_PROTO_MAX);
- if (e->flags & (1 << NFTNL_EXPR_REDIR_FLAGS))
- nftnl_buf_u32(&b, type, redir->flags, FLAGS);
-
- return nftnl_buf_done(&b);
-}
-
static int nftnl_expr_redir_snprintf_default(char *buf, size_t len,
const struct nftnl_expr *e)
{
@@ -209,7 +167,6 @@ nftnl_expr_redir_snprintf(char *buf, size_t len, uint32_t type,
return nftnl_expr_redir_snprintf_default(buf, len, e);
case NFTNL_OUTPUT_XML:
case NFTNL_OUTPUT_JSON:
- return nftnl_expr_redir_export(buf, len, e, type);
default:
break;
}
@@ -243,5 +200,4 @@ struct expr_ops expr_ops_redir = {
.parse = nftnl_expr_redir_parse,
.build = nftnl_expr_redir_build,
.snprintf = nftnl_expr_redir_snprintf,
- .json_parse = nftnl_expr_redir_json_parse,
};