diff options
Diffstat (limited to 'src/expr/queue.c')
-rw-r--r-- | src/expr/queue.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/src/expr/queue.c b/src/expr/queue.c index a392a27..e71df7d 100644 --- a/src/expr/queue.c +++ b/src/expr/queue.c @@ -143,35 +143,6 @@ nftnl_expr_queue_parse(struct nftnl_expr *e, struct nlattr *attr) return 0; } -static int -nftnl_expr_queue_json_parse(struct nftnl_expr *e, json_t *root, - struct nftnl_parse_err *err) -{ -#ifdef JSON_PARSING - uint32_t sreg_qnum; - uint16_t type; - uint16_t code; - - if (nftnl_jansson_parse_val(root, "num", NFTNL_TYPE_U16, &type, err) == 0) - nftnl_expr_set_u16(e, NFTNL_EXPR_QUEUE_NUM, type); - - if (nftnl_jansson_parse_val(root, "total", NFTNL_TYPE_U16, &code, err) == 0) - nftnl_expr_set_u16(e, NFTNL_EXPR_QUEUE_TOTAL, code); - - if (nftnl_jansson_parse_val(root, "flags", NFTNL_TYPE_U16, &code, err) == 0) - nftnl_expr_set_u16(e, NFTNL_EXPR_QUEUE_FLAGS, code); - - if (nftnl_jansson_parse_val(root, "sreg_qnum", NFTNL_TYPE_U32, &sreg_qnum, - err) == 0) - nftnl_expr_set_u32(e, NFTNL_EXPR_QUEUE_SREG_QNUM, sreg_qnum); - - return 0; -#else - errno = EOPNOTSUPP; - return -1; -#endif -} - static int nftnl_expr_queue_snprintf_default(char *buf, size_t len, const struct nftnl_expr *e) { @@ -213,24 +184,6 @@ static int nftnl_expr_queue_snprintf_default(char *buf, size_t len, return offset; } -static int nftnl_expr_queue_export(char *buf, size_t size, - const struct nftnl_expr *e, int type) -{ - struct nftnl_expr_queue *queue = nftnl_expr_data(e); - NFTNL_BUF_INIT(b, buf, size); - - if (e->flags & (1 << NFTNL_EXPR_QUEUE_NUM)) - nftnl_buf_u32(&b, type, queue->queuenum, NUM); - if (e->flags & (1 << NFTNL_EXPR_QUEUE_TOTAL)) - nftnl_buf_u32(&b, type, queue->queues_total, TOTAL); - if (e->flags & (1 << NFTNL_EXPR_QUEUE_FLAGS)) - nftnl_buf_u32(&b, type, queue->flags, FLAGS); - if (e->flags & (1 << NFTNL_EXPR_QUEUE_SREG_QNUM)) - nftnl_buf_u32(&b, type, queue->sreg_qnum, SREG_QNUM); - - return nftnl_buf_done(&b); -} - static int nftnl_expr_queue_snprintf(char *buf, size_t len, uint32_t type, uint32_t flags, const struct nftnl_expr *e) @@ -240,7 +193,6 @@ nftnl_expr_queue_snprintf(char *buf, size_t len, uint32_t type, return nftnl_expr_queue_snprintf_default(buf, len, e); case NFTNL_OUTPUT_XML: case NFTNL_OUTPUT_JSON: - return nftnl_expr_queue_export(buf, len, e, type); default: break; } @@ -276,5 +228,4 @@ struct expr_ops expr_ops_queue = { .parse = nftnl_expr_queue_parse, .build = nftnl_expr_queue_build, .snprintf = nftnl_expr_queue_snprintf, - .json_parse = nftnl_expr_queue_json_parse, }; |