path: root/src/payload.c
diff options
authorVarsha Rao <>2017-06-16 14:54:06 +0530
committerPablo Neira Ayuso <>2017-06-18 11:23:00 +0200
commit35f6cd327c2ec46296adf464f981cd6cddfec27b (patch)
tree7341c05e6f7499fa3da18a4e50dd9db0ca36339b /src/payload.c
parent509671dfa03365bba727b8be5e522b737da93a6f (diff)
src: Pass stateless, numeric, ip2name and handle variables as structure members.
libnftables library will be created soon. So declare numeric_output, stateless_output, ip2name_output and handle_output as members of structure output_ctx, instead of global variables. Rename these variables as following, numeric_output -> numeric stateless_output -> stateless ip2name_output -> ip2name handle_output -> handle Also add struct output_ctx *octx as member of struct netlink_ctx. Signed-off-by: Varsha Rao <> Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'src/payload.c')
1 files changed, 4 insertions, 4 deletions
diff --git a/src/payload.c b/src/payload.c
index 11b6df37..7f94ff7f 100644
--- a/src/payload.c
+++ b/src/payload.c
@@ -38,7 +38,7 @@ bool payload_is_known(const struct expr *expr)
tmpl != &proto_unknown_template;
-static void payload_expr_print(const struct expr *expr)
+static void payload_expr_print(const struct expr *expr, struct output_ctx *octx)
const struct proto_desc *desc;
const struct proto_hdr_template *tmpl;
@@ -184,11 +184,11 @@ unsigned int payload_hdr_field(const struct expr *expr)
return expr->payload.tmpl - expr->payload.desc->templates;
-static void payload_stmt_print(const struct stmt *stmt)
+static void payload_stmt_print(const struct stmt *stmt, struct output_ctx *octx)
- expr_print(stmt->payload.expr);
+ expr_print(stmt->payload.expr, octx);
printf(" set ");
- expr_print(stmt->payload.val);
+ expr_print(stmt->payload.val, octx);
static const struct stmt_ops payload_stmt_ops = {